[Bug c++/51138] New: [C++0x] [4.6 Regression] Uninitialized list elements
reichelt at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 15 07:59:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51138
Bug #: 51138
Summary: [C++0x] [4.6 Regression] Uninitialized list elements
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: reichelt@gcc.gnu.org
The following code snippet does not work as expected when compiled with
"-std=c++0x" even at "-O0" - it returns 42 instead of 0 (on i686-pc-linux-gnu).
===========================================
#include<list>
int main()
{
{
const std::list<int> a(100, 42);
}
const std::list<int> b(1);
return b.back();
}
===========================================
The bug only happens with GCC 4.6.x, trunk seems to be unaffected.
More information about the Gcc-bugs
mailing list