Commit b646edb8 by Volker Reichelt Committed by Volker Reichelt

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
parent a97728cf
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.
......
......@@ -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. */
......
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.
// PR c++/28710
// { dg-do compile }
template<int> union A; // { dg-error "previous" }
struct A; // { dg-error "non-template" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment