re PR c++/45043 (ICE: tree check: expected identifier_node, have bit_not_expr in grokdeclarator, at cp/decl.c:8113 on invalid code)

/cp
2010-08-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/45043
	* decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.

/testsuite
2010-08-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/45043
	* g++.dg/template/crash102.C: New.

From-SVN: r163655
This commit is contained in:
Paolo Carlini 2010-08-30 18:13:32 +00:00 committed by Paolo Carlini
parent b0268cc04f
commit b960ce040d
4 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/45043
* decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
2010-08-30 Jakub Jelinek <jakub@redhat.com>
PR middle-end/45423

View File

@ -8115,7 +8115,8 @@ grokdeclarator (const cp_declarator *declarator,
common. With no options, it is allowed. With -Wreturn-type,
it is a warning. It is only an error with -pedantic-errors. */
is_main = (funcdef_flag
&& dname && MAIN_NAME_P (dname)
&& dname && TREE_CODE (dname) == IDENTIFIER_NODE
&& MAIN_NAME_P (dname)
&& ctype == NULL_TREE
&& in_namespace == NULL_TREE
&& current_namespace == global_namespace);

View File

@ -1,3 +1,8 @@
2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/45043
* g++.dg/template/crash102.C: New.
2010-08-30 Jakub Jelinek <jakub@redhat.com>
PR middle-end/45423

View File

@ -0,0 +1,5 @@
// PR c++/45043
template < typename > class A;
template < typename T > A < T >::B::~B () // { dg-error "type" }
{}