[Bug c++/52905] New: [C++0x] ice on invalid brace-enclosed initializer of vector of enums

dirkmoermans at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Apr 8 15:50:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52905

             Bug #: 52905
           Summary: [C++0x] ice on invalid brace-enclosed initializer of
                    vector of enums
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dirkmoermans@gmail.com


The invalid code below ICEs on gcc 4.6.1 and gcc 4.7.0.

It is caused by passing an int as an initializer to a vector of enums.

===
#include <vector>

enum ev {a,b,c};
std::vector<ev> v{a,-1}; // ICE
// std::vector<ev> v{a,b}; // passes
===

The messages are:

internal compiler error: in joust, at cp/call.c:7642 (g++-4.6.1)

internal compiler error: in joust, at cp/call.c:8009 (g++-4.7)



More information about the Gcc-bugs mailing list