| Summary: | C++11: Code analysis warns about member not initialized in deleted and defaulted constructors | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Jiangbin Zhao <zhaojiangbin> |
| Component: | cdt-codan | Assignee: | 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: | |||
Duplicate of bug 395018 (which has been fixed). *** This bug has been marked as a duplicate of bug 395018 *** |
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