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

--- Comment #11 from Dmitry G. Dyachenko <dimhen at gmail dot com> ---
Original test case from c#0 crash in trunk
gcc version 10.0.0 20191204 (experimental) [trunk revision 278972] (GCC)

$ g++ -fpreprocessed -fsyntax-only a.ii 
a.ii:5:1: error: types may not be defined in template arguments
    5 | {
      | ^
a.ii:6:1: error: ISO C++ forbids declaration of ‘f’ with no type [-fpermissive]
    6 | f () :
      | ^
a.ii:6:6: error: expected ‘}’ at end of input
    6 | f () :
      |      ^
a.ii:5:1: note: to match this ‘{’
    5 | {
      | ^
a.ii:6:6: error: expected template-argument at end of input
    6 | f () :
      |      ^
a.ii:6:6: error: expected ‘>’ at end of input
a.ii:4:1: error: expected unqualified-id at end of input
    4 | A < struct
      | ^~~~~~~~~~
    5 | {
      | ~
    6 | f () :
      | ~~~~~~
a.ii:4:1: error: expected ‘}’ at end of input
a.ii:3:1: note: to match this ‘{’
    3 | {
      | ^
a.ii:4:1: internal compiler error: in cp_lexer_new_from_tokens, at
cp/parser.c:698
    4 | A < struct
      | ^~~~~~~~~~
    5 | {
      | ~
    6 | f () :
      | ~~~~~~
0x6541ef cp_parser_push_lexer_for_tokens
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:698
0xbb3005 cp_parser_late_parsing_for_member
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:29559
0xb91ee7 cp_parser_class_specifier_1
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:23942
0xb92e83 cp_parser_class_specifier
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:23966
0xb92e83 cp_parser_type_specifier
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:17576
0xb93f0f cp_parser_decl_specifier_seq
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:14249
0xbb95a5 cp_parser_single_declaration
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:29075
0xbb992b cp_parser_template_declaration_after_parameters
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:28738
0xbba080 cp_parser_explicit_template_declaration
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:29004
0xbbd3e9 cp_parser_declaration
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:13271
0xbbda0a cp_parser_translation_unit
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:4721
0xbbda0a c_parse_file()
        /home/dimhen/src/gcc_current/gcc/cp/parser.c:43048
0xccf60b c_common_parse_file()
        /home/dimhen/src/gcc_current/gcc/c-family/c-opts.c:1185
Please submit a full bug report,

Reply via email to