PR c++/28058
* pt.c (register_specialization): Return error_mark_node for
specialization-after-instantiation.
* decl2.c (mark_used): Mark the main function used when one of its
clones is used.
PR c++/28058
* g++.dg/template/spec31.C: New test.
From-SVN: r116491
+2006-08-27 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28058
+ * pt.c (register_specialization): Return error_mark_node for
+ specialization-after-instantiation.
+ * decl2.c (mark_used): Mark the main function used when one of its
+ clones is used.
+
2006-08-27 Lee Millward <lee.millward@codesourcery.com>
PR c++/26573
}
TREE_USED (decl) = 1;
+ if (DECL_CLONED_FUNCTION_P (decl))
+ TREE_USED (DECL_CLONED_FUNCTION (decl)) = 1;
/* If we don't need a value, then we don't need to synthesize DECL. */
if (skip_evaluation)
return;
{
error ("specialization of %qD after instantiation",
fn);
- return spec;
+ return error_mark_node;
}
else
{
+2006-08-27 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28058
+ * g++.dg/template/spec31.C: New test.
+
2006-08-27 Lee Millward <lee.millward@codesourcery.com>
PR c++/26573
--- /dev/null
+// PR c++/28058
+
+template<int> struct A
+{
+ A() {}
+};
+
+A<0> a;
+
+template<> A<0>::A() {} // { dg-error "specialization" }