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

Reply via email to