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++/81247] New: ICE on invalid C++ code with malformed namespace declaration: in do_push_nested_namespace, at cp/name-lookup.c:6002


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

            Bug ID: 81247
           Summary: ICE on invalid C++ code with malformed namespace
                    declaration: in do_push_nested_namespace, at
                    cp/name-lookup.c:6002
           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: ---

$ 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/8.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 8.0.0 20170629 (experimental) [trunk revision 249769] (GCC) 
$ 
$ g++-trunk -c small.cpp
small.cpp:2:1: error: expected ‘{’ before ‘template’
 template < typename T > class A
 ^~~~~~~~
small.cpp: In instantiation of ‘class N::A<char>’:
small.cpp:10:14:   required from here
small.cpp:3:1: internal compiler error: in do_push_nested_namespace, at
cp/name-lookup.c:6002
 {
 ^
0x7c73e0 do_push_nested_namespace
        ../../gcc-source-trunk/gcc/cp/name-lookup.c:5999
0x7c740c push_nested_namespace(tree_node*)
        ../../gcc-source-trunk/gcc/cp/name-lookup.c:6290
0x880845 tsubst_friend_class
        ../../gcc-source-trunk/gcc/cp/pt.c:9995
0x880845 instantiate_class_template_1
        ../../gcc-source-trunk/gcc/cp/pt.c:10725
0x880845 instantiate_class_template(tree_node*)
        ../../gcc-source-trunk/gcc/cp/pt.c:10923
0x8dac2a complete_type(tree_node*)
        ../../gcc-source-trunk/gcc/cp/typeck.c:134
0x7232e8 start_decl_1(tree_node*, bool)
        ../../gcc-source-trunk/gcc/cp/decl.c:5147
0x749c0d start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc-source-trunk/gcc/cp/decl.c:5110
0x806698 cp_parser_init_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:19410
0x809308 cp_parser_simple_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12945
0x80a0a1 cp_parser_block_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12763
0x80ab08 cp_parser_declaration_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:12357
0x7ed5b7 cp_parser_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10840
0x7ee4df cp_parser_statement_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:11176
0x7ee5cf cp_parser_compound_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:11130
0x8056cf cp_parser_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:21592
0x8056cf cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:21628
0x806171 cp_parser_function_definition_after_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:26460
0x806ecd cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:26372
0x806ecd cp_parser_init_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:19312
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.
$ 


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


namespace N 
template < typename T > class A
{
  template < T > friend class N;
};

void f ()
{
  A < int > a1;
  A < char > a2;
}

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