This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/79657] ICE on invalid c++ code in finish_underlying_type cp/semantics.c:3849
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Feb 2017 12:59:41 +0000
- Subject: [Bug c++/79657] ICE on invalid c++ code in finish_underlying_type cp/semantics.c:3849
- Auto-submitted: auto-generated
- References: <bug-79657-4@http.gcc.gnu.org/bugzilla/>
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)) {} };
^