Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368611 - Bogus warning in template partial specialization
Summary: Bogus warning in template partial specialization
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 8.1.0   Edit
Assignee: Marc-André Laperle CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-15 00:37 EST by Nathan Ridge CLA
Modified: 2013-02-27 11:42 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Ridge CLA 2012-01-15 00:37:18 EST
I'm filing this under indexer rather than codan because the warning only appears when some of the code is in a header file, suggesting an indexer issue.


test.hpp:

template <typename, int>
struct B;


test.cpp:

#include "test.hpp"

template <typename>
struct A
{
};

template <typename valueT>
struct B<A<valueT>, 0>
{
    B(const A<valueT>& o) : obj(o) {}  // BOGUS WARNING HERE

    const A<valueT>& obj;
};


The warning at the indicated line is: "Member 'obj' was not initialized in this constructor"
Comment 1 Marc-André Laperle CLA 2012-01-15 04:28:27 EST
I'll look at the code on the codan side and change the component back to cdt-indexer if necessary.
Comment 2 Marc-André Laperle CLA 2012-05-13 13:48:06 EDT
It was a problem in the checker. Fixed in 8.1.0. Thanks for the report and sample code!
Comment 3 CDT Genie CLA 2013-02-27 11:42:35 EST
*** cdt git genie on behalf of Marc-Andre Laperle ***

    Bug 368611 - Bogus warning in template partial specialization

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=af1c5c31d1dd6ec111ed9262ca8fdbcb22e2e37f