This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/77339] New: ICE on invalid C++ code on x86_64-linux-gnu: in cp_parser_type_name, at cp/parser.c:16532


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

            Bug ID: 77339
           Summary: ICE on invalid C++ code on x86_64-linux-gnu: in
                    cp_parser_type_name, at cp/parser.c:16532
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

It affects 4.8.x and later, and is a regression from 4.7.x.


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160822 (experimental) [trunk revision 239655] (GCC) 
$ 
$ g++-trunk -c small.cpp
small.cpp:3:25: internal compiler error: in cp_parser_type_name, at
cp/parser.c:16532
 template < typename X > A < X >::a;
                         ^~~~~~~
0x7a94ec cp_parser_type_name
        ../../gcc-source-trunk/gcc/cp/parser.c:16532
0x797f89 cp_parser_type_name
        ../../gcc-source-trunk/gcc/cp/parser.c:16482
0x797f89 cp_parser_simple_type_specifier
        ../../gcc-source-trunk/gcc/cp/parser.c:16396
0x793e71 cp_parser_type_specifier
        ../../gcc-source-trunk/gcc/cp/parser.c:16049
0x7a8d33 cp_parser_decl_specifier_seq
        ../../gcc-source-trunk/gcc/cp/parser.c:12889
0x7b7d15 cp_parser_single_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:25934
0x7b808c cp_parser_template_declaration_after_parameters
        ../../gcc-source-trunk/gcc/cp/parser.c:25630
0x7b8aa1 cp_parser_explicit_template_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:25861
0x7b8aa1 cp_parser_template_declaration_after_export
        ../../gcc-source-trunk/gcc/cp/parser.c:25879
0x7c00e9 cp_parser_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12209
0x7beb34 cp_parser_declaration_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:12139
0x7bee78 cp_parser_translation_unit
        ../../gcc-source-trunk/gcc/cp/parser.c:4356
0x7bee78 c_parse_file()
        ../../gcc-source-trunk/gcc/cp/parser.c:37671
0x92c462 c_common_parse_file()
        ../../gcc-source-trunk/gcc/c-family/c-opts.c:1073
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


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


template < typename > using A = int;

//OK: template < typename X > A < X > a; 
template < typename X > A < X >::a;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]