This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/51138] New: [C++0x] [4.6 Regression] Uninitialized list elements


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]