[Bug c++/79657] ICE on invalid c++ code in finish_underlying_type cp/semantics.c:3849

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 21 12:59:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79657

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
$ clang++ -c u.cc
u.cc:1:15: error: cannot determine underlying type of incomplete enumeration
type 'E'
enum E { a = (__underlying_type (E)) {} };
              ^
u.cc:1:6: note: forward declaration of 'E'
enum E { a = (__underlying_type (E)) {} };
     ^
u.cc:1:38: error: expression is not an integral constant expression
enum E { a = (__underlying_type (E)) {} };
                                     ^~
2 errors generated.


but we just segv:

$ ./cc1plus -quiet u.cc -Wall -Wpedantic
u.cc:1:35: internal compiler error: Segmentation fault
 enum E { a = (__underlying_type (E)) {} };
                                   ^


More information about the Gcc-bugs mailing list