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

Bug 383969

Summary: C++11: Code analysis warns about member not initialized in deleted and defaulted constructors
Product: [Tools] CDT Reporter: Jiangbin Zhao <zhaojiangbin>
Component: cdt-codanAssignee: CDT Codan Inbox <cdt-codan-inbox>
Status: CLOSED DUPLICATE QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, malaperle, yevshif, zeratul976
Version: 8.1.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jiangbin Zhao CLA 2012-06-30 15:52:43 EDT
Put this class definition in a header file:

struct X
{
    int _i;
    X(int v = 0) : _i(0) {}
    X(X&&) = default;
    X(X const&) = delete;
};

Code analysis gives two warnings in the "Problems" window. Also note the wrong line number given in the Location column:

Description	Resource	Path	Location	Type
Member '_i' was not initialized in this constructor 	X.hpp	/bug	line 1	Code Analysis Problem
Member '_i' was not initialized in this constructor 	X.hpp	/bug	line 1	Code Analysis Problem

-- Configuration Details --
Product: Eclipse 1.5.0.20120131-1544 (org.eclipse.epp.package.cpp.product)
Installed Features:
 org.eclipse.platform 4.2.0.v20120608-135145-9JF7BHV8FyMteji0Oi_ePMz0xuZ8TVo7lV0z0ecb
Comment 1 Nathan Ridge CLA 2013-07-07 23:59:12 EDT
Duplicate of bug 395018 (which has been fixed).
Comment 2 Marc-André Laperle CLA 2013-07-08 00:31:48 EDT

*** This bug has been marked as a duplicate of bug 395018 ***