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

            Bug ID: 95985
           Summary: [11 Regression] ICE: tree check: expected tree_list,
                    have error_mark in common_handle_aligned_attribute, at
                    c-family/c-attribs.c:1980
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-11.0.0-alpha20200628 snapshot (g:b26fd416fb0a734d3f3e56629b6dff2e3c25dd40)
ICEs when compiling the following testcase, extracted from
test/std/utilities/variant/variant.variant/variant_void.fail.cpp from the
libcxx 10.0.0 test suite:

template <typename>
struct pf {
  struct sr;
  alignas (sr) int ci;
};

pf<int> ci;

% g++-11.0.0 -c hdbdodhk.cpp
hdbdodhk.cpp: In instantiation of 'struct pf<int>':
hdbdodhk.cpp:7:9:   required from here
hdbdodhk.cpp:4:12: error: invalid application of '__alignof__' to incomplete
type 'pf<int>::sr'
    4 |   alignas (sr) int ci;
      |            ^~
hdbdodhk.cpp:4:20: internal compiler error: tree check: expected tree_list,
have error_mark in common_handle_aligned_attribute, at
c-family/c-attribs.c:1980
    4 |   alignas (sr) int ci;
      |                    ^~
0x7c7f86 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/tree.c:9685
0x6b475b tree_check(tree_node*, char const*, int, char const*, tree_code)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/tree.h:3301
0x6b475b common_handle_aligned_attribute
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/c-family/c-attribs.c:1980
0xaa3247 decl_attributes(tree_node**, tree_node*, int, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/attribs.c:714
0x92e187 cplus_decl_attributes(tree_node**, tree_node*, int)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/decl2.c:1601
0xa0cb99 tsubst_decl
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/pt.c:14379
0xa303cd instantiate_class_template_1
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/pt.c:11843
0xa317f2 instantiate_class_template(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/pt.c:12098
0xa7a109 complete_type(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/typeck.c:137
0x8fc4a3 start_decl_1(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/decl.c:5490
0x91e888 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/decl.c:5453
0x9ce4b1 cp_parser_init_declarator
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/parser.c:20818
0x9aeb76 cp_parser_simple_declaration
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/parser.c:13785
0x9d92f6 cp_parser_declaration
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/parser.c:13484
0x9d9a4f cp_parser_translation_unit
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/parser.c:4761
0x9d9a4f c_parse_file()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/cp/parser.c:44043
0xaf677b c_common_parse_file()
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200628/work/gcc-11-20200628/gcc/c-family/c-opts.c:1190

Reply via email to