re PR c++/28293 (ICE on invalid typedef)

/cp
2009-09-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/28293
	* decl2.c (grokfield): Check for explicit template argument lists.

/testsuite
2009-09-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/28293
	* g++.dg/template/crash91.C: New.

From-SVN: r151581
This commit is contained in:
Paolo Carlini 2009-09-09 23:33:38 +00:00 committed by Paolo Carlini
parent e7e5ba0984
commit 3937f036d7
2 changed files with 17 additions and 6 deletions

View File

@ -1,7 +1,7 @@
2009-09-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/28293
* decl.c (grokfield): Check for explicit template argument lists.
* decl2.c (grokfield): Check for explicit template argument lists.
2009-09-09 Jack Howarth <howarth@bromo.med.uc.edu>

View File

@ -764,6 +764,7 @@ grokfield (const cp_declarator *declarator,
tree value;
const char *asmspec = 0;
int flags = LOOKUP_ONLYCONVERTING;
tree name;
if (init
&& TREE_CODE (init) == TREE_LIST
@ -792,11 +793,21 @@ grokfield (const cp_declarator *declarator,
&& DECL_CONTEXT (value) != current_class_type)
return value;
if (DECL_NAME (value) != NULL_TREE
&& IDENTIFIER_POINTER (DECL_NAME (value))[0] == '_'
&& ! strcmp (IDENTIFIER_POINTER (DECL_NAME (value)), "_vptr"))
error ("member %qD conflicts with virtual function table field name",
value);
name = DECL_NAME (value);
if (name != NULL_TREE)
{
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{
error ("explicit template argument list not allowed");
return error_mark_node;
}
if (IDENTIFIER_POINTER (name)[0] == '_'
&& ! strcmp (IDENTIFIER_POINTER (name), "_vptr"))
error ("member %qD conflicts with virtual function table field name",
value);
}
/* Stash away type declarations. */
if (TREE_CODE (value) == TYPE_DECL)