* decl.c (xref_tag): Issue errors about redeclaring template
classes as non-template classes.
PR c++/15025
* g++.dg/template/redecl1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82172
138bc75d-0d04-0410-961f-
82ee72b054a4
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
* name-lookup.c (supplement_binding): Allow redefinitions of
namespace aliases.
{
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
* g++.dg/other/ns1.C: New test.
--- /dev/null
+// PR c++/15025
+
+template <int> struct X;
+struct X {}; // { dg-error "" }