This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51138] New: [C++0x] [4.6 Regression] Uninitialized list elements
- From: "reichelt at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Nov 2011 07:18:32 +0000
- Subject: [Bug c++/51138] New: [C++0x] [4.6 Regression] Uninitialized list elements
- Auto-submitted: auto-generated
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.