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++/79657] ICE on invalid c++ code in finish_underlying_type cp/semantics.c:3849


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)) {} };
                                   ^

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