https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85033
Bug ID: 85033 Summary: internal compiler error: in fold_offsetof_1, at c-family/c-common.c:6269 Product: gcc Version: 8.0.1 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vegard.nossum at oracle dot com CC: webrown.cpp at gmail dot com Target Milestone: --- Input: int b = __builtin_offsetof(struct { enum { a }; }, a) Output: $ cc1plus <stdin>:1:53: internal compiler error: in fold_offsetof_1, at c-family/c-common.c:6269 0x1502073 fold_offsetof_1(tree_node*, tree_code) /home/vegard/git/gcc/gcc/c-family/c-common.c:6269 0x1504a82 fold_offsetof(tree_node*) /home/vegard/git/gcc/gcc/c-family/c-common.c:6280 0xf38c24 cp_parser_builtin_offsetof /home/vegard/git/gcc/gcc/cp/parser.c:9897 0xf38c24 cp_parser_primary_expression /home/vegard/git/gcc/gcc/cp/parser.c:5396 0xf7698b cp_parser_postfix_expression /home/vegard/git/gcc/gcc/cp/parser.c:7030 0xf2a4b7 cp_parser_unary_expression /home/vegard/git/gcc/gcc/cp/parser.c:8322 0xebfeca cp_parser_cast_expression /home/vegard/git/gcc/gcc/cp/parser.c:9090 0xec24f6 cp_parser_binary_expression /home/vegard/git/gcc/gcc/cp/parser.c:9191 0xec62ca cp_parser_assignment_expression /home/vegard/git/gcc/gcc/cp/parser.c:9486 0xecc0a3 cp_parser_constant_expression /home/vegard/git/gcc/gcc/cp/parser.c:9770 0xed334e cp_parser_initializer_clause /home/vegard/git/gcc/gcc/cp/parser.c:21916 0xedc293 cp_parser_initializer /home/vegard/git/gcc/gcc/cp/parser.c:21856 0xfa0f3d cp_parser_init_declarator /home/vegard/git/gcc/gcc/cp/parser.c:19677 0xfa57a7 cp_parser_simple_declaration /home/vegard/git/gcc/gcc/cp/parser.c:13065 0xfab998 cp_parser_block_declaration /home/vegard/git/gcc/gcc/cp/parser.c:12883 0xffead5 cp_parser_declaration /home/vegard/git/gcc/gcc/cp/parser.c:12780 0xff5b8b cp_parser_declaration_seq_opt /home/vegard/git/gcc/gcc/cp/parser.c:12656 0xff71b3 cp_parser_translation_unit /home/vegard/git/gcc/gcc/cp/parser.c:4561 0xff71b3 c_parse_file() /home/vegard/git/gcc/gcc/cp/parser.c:38995 0x15a3a25 c_common_parse_file() /home/vegard/git/gcc/gcc/c-family/c-opts.c:1132 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Version: GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu) Seems to go back to 4.1.2. cc1 prints this instead: <stdin>:1:47: warning: declaration does not declare anything <stdin>:1:9: error: 'struct <anonymous>' has no member named 'a' <stdin>:1:44: error: expected ',' or ';' at end of input