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: unassig...@gcc.gnu.org
        ReportedBy: reich...@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.

Reply via email to