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

            Bug ID: 86063
           Summary: g++ ICE at  tree check: expected tree_list, have
                    expr_pack_expansion in cp_check_const_attributes, at
                    cp/decl2.c:1391
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It appears to be a recent regression.

g++-7.3 compiles.






$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180604 (experimental) [trunk revision 261145] (GCC) 


$ g++-trunk abc.cpp
abc.cpp:1:64: internal compiler error: tree check: expected tree_list, have
expr_pack_expansion in cp_check_const_attributes, at cp/decl2.c:1391
 template <class... T> struct A2 { [[gnuA(alignof(T))...]] char t; };
                                                                ^
0x798b88 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9338
0x6127bf tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../gcc/gcc/tree.h:3135
0x6127bf cp_check_const_attributes
        ../../gcc/gcc/cp/decl2.c:1391
0x6127bf cplus_decl_attributes(tree_node**, tree_node*, int)
        ../../gcc/gcc/cp/decl2.c:1509
0x8bcbed grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
        ../../gcc/gcc/cp/decl2.c:967
0x9327cd cp_parser_member_declaration
        ../../gcc/gcc/cp/parser.c:24017
0x933828 cp_parser_member_specification_opt
        ../../gcc/gcc/cp/parser.c:23496
0x933828 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:22640
0x935649 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:22902
0x935649 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:16883
0x94282c cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:13721
0x946f45 cp_parser_single_declaration
        ../../gcc/gcc/cp/parser.c:27319
0x9472cc cp_parser_template_declaration_after_parameters
        ../../gcc/gcc/cp/parser.c:27011
0x947b6e cp_parser_explicit_template_declaration
        ../../gcc/gcc/cp/parser.c:27248
0x947b6e cp_parser_template_declaration_after_export
        ../../gcc/gcc/cp/parser.c:27267
0x94d0d9 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:12825
0x94d3ad cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:12752
0x94d6a4 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4574
0x94d6a4 c_parse_file()
        ../../gcc/gcc/cp/parser.c:39132
0xa4a7c6 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1133
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.

$ cat abc.cpp
template <class... T> struct A2 { [[gnuA(alignof(T))...]] char t; };

Reply via email to