Commit 99f4234a by Mark Mitchell Committed by Mark Mitchell

re PR c++/28058 (ICE in inline_forbidden_p)

	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
parent bf87e098
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> 2006-08-27 Lee Millward <lee.millward@codesourcery.com>
PR c++/26573 PR c++/26573
......
...@@ -3494,6 +3494,8 @@ mark_used (tree decl) ...@@ -3494,6 +3494,8 @@ mark_used (tree decl)
} }
TREE_USED (decl) = 1; 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 we don't need a value, then we don't need to synthesize DECL. */
if (skip_evaluation) if (skip_evaluation)
return; return;
......
...@@ -1163,7 +1163,7 @@ register_specialization (tree spec, tree tmpl, tree args, bool is_friend) ...@@ -1163,7 +1163,7 @@ register_specialization (tree spec, tree tmpl, tree args, bool is_friend)
{ {
error ("specialization of %qD after instantiation", error ("specialization of %qD after instantiation",
fn); fn);
return spec; return error_mark_node;
} }
else 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> 2006-08-27 Lee Millward <lee.millward@codesourcery.com>
PR c++/26573 PR c++/26573
// PR c++/28058
template<int> struct A
{
A() {}
};
A<0> a;
template<> A<0>::A() {} // { dg-error "specialization" }
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