Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368611

Summary: Bogus warning in template partial specialization
Product: [Tools] CDT Reporter: Nathan Ridge <zeratul976>
Component: cdt-codanAssignee: Marc-André Laperle <malaperle>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, malaperle, yevshif
Version: 8.1.0   
Target Milestone: 8.1.0   
Hardware: All   
OS: All   
Whiteboard:

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