PR c++/15025
* decl.c (xref_tag): Issue errors about redeclaring template
classes as non-template classes.
PR c++/15025
* g++.dg/template/redecl1.C: New test.
From-SVN: r82172
+2004-05-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/15025
+ * decl.c (xref_tag): Issue errors about redeclaring template
+ classes as non-template classes.
+
2004-05-23 Mark Mitchell <mark@codesourcery.com>
PR c++/14821
{
if (!globalize && processing_template_decl && IS_AGGR_TYPE (t))
redeclare_class_template (t, current_template_parms);
+ else if (!processing_template_decl
+ && CLASS_TYPE_P (t)
+ && CLASSTYPE_IS_TEMPLATE (t))
+ {
+ error ("redeclaration of `%T' as a non-template", t);
+ t = error_mark_node;
+ }
}
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
+2004-05-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/15025
+ * g++.dg/template/redecl1.C: New test.
+
2004-05-23 Mark Mitchell <mark@codesourcery.com>
PR c++/14821
--- /dev/null
+// PR c++/15025
+
+template <int> struct X;
+struct X {}; // { dg-error "" }