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

            Bug ID: 86663
           Summary: g++ ICE with -std=c++11
           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: ---

With "-std=c++11", it affects g++ as early as 4.8. Clang could compile it.

$ 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 20180724 (experimental) [trunk revision 262942] (GCC) 


$ g++-trunk -std=c++11 abc.C
abc.C:2:7: internal compiler error: Segmentation fault
 a<char>;
       ^
0xebf0cf crash_signal
        ../../gcc/gcc/toplev.c:325
0x98728c lookup_template_class_1
        ../../gcc/gcc/cp/pt.c:9618
0x98728c lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        ../../gcc/gcc/cp/pt.c:9666
0x9b7b2d finish_template_type(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/semantics.c:3228
0x9360e4 cp_parser_template_id
        ../../gcc/gcc/cp/parser.c:15988
0x9361f3 cp_parser_class_name
        ../../gcc/gcc/cp/parser.c:22518
0x9428bf cp_parser_qualifying_entity
        ../../gcc/gcc/cp/parser.c:6601
0x9428bf cp_parser_nested_name_specifier_opt
        ../../gcc/gcc/cp/parser.c:6287
0x94b08e cp_parser_constructor_declarator_p
        ../../gcc/gcc/cp/parser.c:26669
0x94b08e cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:13737
0x9507b0 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:13058
0x9558b2 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:12903
0x955cad cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:12779
0x955fa4 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4603
0x955fa4 c_parse_file()
        ../../gcc/gcc/cp/parser.c:39117
0xa51fe0 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1138
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.


$ g++-4.8 -std=c++11 abc.C
abc.C:2:7: internal compiler error: Segmentation fault
 a<char>;
       ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccksnSsC.out file, please attach this to
your bugreport.
ERROR: Cannot create report: [Errno 17] File exists:
'/var/crash/_usr_lib_gcc_x86_64-linux-gnu_4.8_cc1plus.1000.crash'


$ cat abc.C
template <typename a> using a = a;
a<char>;

Reply via email to