http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57178
Bug #: 57178
Summary: bogus warning with -O3 using boost::optional
Classification: Unclassified
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
GCC appears to be producing a bogus warning about an unitialized value. This
happens at optimization levels -O1 and higher. It uses a boost optional as I
was unable to reduce it to something more fundamental.
Command line:
g++ -c uninit_warn.cpp --std=c++0x -Wuninitialized -O1
Warning:
uninit_warn.cpp: In function ‘void test(boost::optional<int>)’:
uninit_warn.cpp:17:12: warning: ‘*((void*)& q +4)’ may be used uninitialised in
this function [-Wuninitialized]