[Bug c++/83824] New: ICE on invalid C++ code with alignas: in chainon, at tree.c:3037

su at cs dot ucdavis.edu gcc-bugzilla@gcc.gnu.org
Sat Jan 13 04:59:00 GMT 2018


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

            Bug ID: 83824
           Summary: ICE on invalid C++ code with alignas: in chainon, at
                    tree.c:3037
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

This looks to be a recent regression. 

$ g++tk -v
Using built-in specs.
COLLECT_GCC=g++tk
COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 8.0.0 20180112 (experimental) [trunk revision 256599] (GCC) 
$ 
$ g++-7.2.0 -c tmp.cpp
tmp.cpp: In function ‘void f()’:
tmp.cpp:3:7: error: expected primary-expression before ‘alignas’
   if (alignas(1 alignas(1)));
       ^~~~~~~
tmp.cpp:3:7: error: expected ‘)’ before ‘alignas’
$ 
$ g++tk -c tmp.cpp
tmp.cpp: In function ‘void f()’:
tmp.cpp:3:28: internal compiler error: in chainon, at tree.c:3037
   if (alignas(1 alignas(1)));
                            ^
0x117f0ec chainon(tree_node*, tree_node*)
        ../../gcc-source-trunk/gcc/tree.c:3037
0x815903 cp_parser_decl_specifier_seq
        ../../gcc-source-trunk/gcc/cp/parser.c:13408
0x82023b cp_parser_condition
        ../../gcc-source-trunk/gcc/cp/parser.c:11515
0x8031e2 cp_parser_selection_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:11313
0x8031e2 cp_parser_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10760
0x80443f cp_parser_statement_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:11206
0x80452f cp_parser_compound_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:11160
0x818dae cp_parser_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:21702
0x818dae cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:21737
0x819882 cp_parser_function_definition_after_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:26635
0x81d25d cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:26552
0x81d25d cp_parser_init_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:19426
0x81e8c8 cp_parser_simple_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12997
0x81f74f cp_parser_block_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12815
0x82adf0 cp_parser_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12712
0x829a34 cp_parser_declaration_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:12588
0x829d77 cp_parser_translation_unit
        ../../gcc-source-trunk/gcc/cp/parser.c:4559
0x829d77 c_parse_file()
        ../../gcc-source-trunk/gcc/cp/parser.c:38801
0x974d85 c_common_parse_file()
        ../../gcc-source-trunk/gcc/c-family/c-opts.c:1127
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.
$ 


--------------------------------


void f () 
{
  if (alignas(1 alignas(1)));
}


More information about the Gcc-bugs mailing list