re PR c++/37649 (ICE with invalid template class)

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

	PR c++/37649
	* name-lookup.c (maybe_process_template_type_declaration): Check
	return value of push_template_decl_real for error_mark_node.

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

	PR c++/37649
	* g++.dg/template/crash82.C: New.

From-SVN: r140670
This commit is contained in:
Paolo Carlini 2008-09-25 20:38:32 +00:00 committed by Paolo Carlini
parent 6ffef2ad23
commit 79faac542c
4 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-09-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/37649
* name-lookup.c (maybe_process_template_type_declaration): Check
return value of push_template_decl_real for error_mark_node.
2008-09-24 Aldy Hernandez <aldyh@redhat.com>
* semantics.c (finish_fname): Pass location to fname_decl.

View File

@ -4936,6 +4936,9 @@ maybe_process_template_type_declaration (tree type, int is_friend,
tree name = DECL_NAME (decl);
decl = push_template_decl_real (decl, is_friend);
if (decl == error_mark_node)
return error_mark_node;
/* If the current binding level is the binding level for the
template parameters (see the comment in
begin_template_parm_list) and the enclosing level is a class

View File

@ -1,3 +1,8 @@
2008-09-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/37649
* g++.dg/template/crash82.C: New.
2008-09-25 Tobias Burnus <burnus@net-b.de>
PR fortran/37504

View File

@ -0,0 +1,6 @@
// PR c++/37649
struct A
{
template<int> struct {}; // { dg-error "template class without a name" }
};