re PR c++/28710 (ICE redeclaring template as non-template)

PR c++/28710
	* decl.c (xref_tag): Improve error message.  Return early on error.

	* g++.dg/template/redecl4.C: New test.

From-SVN: r116211
This commit is contained in:
Volker Reichelt 2006-08-17 08:06:27 +00:00 committed by Volker Reichelt
parent a97728cfa9
commit b646edb85c
4 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2006-08-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28710
* decl.c (xref_tag): Improve error message. Return early on error.
PR c++/28711
* pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Robustify.

View File

@ -9695,7 +9695,8 @@ xref_tag (enum tag_types tag_code, tree name,
&& CLASSTYPE_IS_TEMPLATE (t))
{
error ("redeclaration of %qT as a non-template", t);
t = error_mark_node;
error ("previous declaration %q+D", t);
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
/* Make injected friend class visible. */

View File

@ -1,5 +1,8 @@
2006-08-17 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28710
* g++.dg/template/redecl4.C: New test.
PR c++/28711
* g++.dg/template/ctor8.C: New test.

View File

@ -0,0 +1,5 @@
// PR c++/28710
// { dg-do compile }
template<int> union A; // { dg-error "previous" }
struct A; // { dg-error "non-template" }