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

            Bug ID: 84644
           Summary: internal compiler error: in
                    warn_misplaced_attr_for_class_type, at cp/decl.c:4718
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vegard.nossum at gmail dot com
  Target Milestone: ---

Input:

template<int a>
struct b {
        decltype(a) __attribute__((break));
};

Output:

$ xgcc -x c++ -S -
<stdin>:3:35: internal compiler error: in warn_misplaced_attr_for_class_type,
at cp/decl.c:4718
0xb37123 warn_misplaced_attr_for_class_type(unsigned int, tree_node*)
        /home/vegard/git/gcc/gcc/cp/decl.c:4718
0xb37123 check_tag_decl(cp_decl_specifier_seq*, bool)
        /home/vegard/git/gcc/gcc/cp/decl.c:4877
0xfe3a56 cp_parser_member_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:23548
0xf160fb cp_parser_member_specification_opt
        /home/vegard/git/gcc/gcc/cp/parser.c:23363
0xf160fb cp_parser_class_specifier_1
        /home/vegard/git/gcc/gcc/cp/parser.c:22505
0xf2501b cp_parser_class_specifier
        /home/vegard/git/gcc/gcc/cp/parser.c:22757
0xf2501b cp_parser_type_specifier
        /home/vegard/git/gcc/gcc/cp/parser.c:16763
0xf8aa5a cp_parser_decl_specifier_seq
        /home/vegard/git/gcc/gcc/cp/parser.c:13625
0xfa575f cp_parser_single_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:27072
0xfc7fd8 cp_parser_template_declaration_after_parameters
        /home/vegard/git/gcc/gcc/cp/parser.c:26761
0xfc65db cp_parser_explicit_template_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:26999
0xfc65db cp_parser_template_declaration_after_export
        /home/vegard/git/gcc/gcc/cp/parser.c:27017
0x1001711 cp_parser_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:12725
0xff826b cp_parser_declaration_seq_opt
        /home/vegard/git/gcc/gcc/cp/parser.c:12652
0xff9893 cp_parser_translation_unit
        /home/vegard/git/gcc/gcc/cp/parser.c:4559
0xff9893 c_parse_file()
        /home/vegard/git/gcc/gcc/cp/parser.c:38880
0x15a51f5 c_common_parse_file()
        /home/vegard/git/gcc/gcc/c-family/c-opts.c:1132

$ xgcc --version
xgcc (GCC) 8.0.1 20180228 (experimental)

Built from git fd1990b25777e5f1307eac1447e8fb5fefe747b4 (r258063).

Seems to start crashing between 5.5.0 and 6.1.0.

Test case was reduced by C-Reduce.

Reply via email to