Commit 6337bd75 by Jason Merrill Committed by Jason Merrill

DR 2179

	DR 2179
	* pt.c (process_partial_specialization): Handle error_mark_node
	from most_specialized_partial_spec.

From-SVN: r229395
parent 59010ede
2015-10-25 Jason Merrill <jason@redhat.com>
DR 2179
* pt.c (process_partial_specialization): Handle error_mark_node
from most_specialized_partial_spec.
2015-10-23 Jason Merrill <jason@redhat.com> 2015-10-23 Jason Merrill <jason@redhat.com>
DR 1518 DR 1518
......
...@@ -4690,14 +4690,18 @@ process_partial_specialization (tree decl) ...@@ -4690,14 +4690,18 @@ process_partial_specialization (tree decl)
: DECL_TEMPLATE_INSTANTIATION (instance)) : DECL_TEMPLATE_INSTANTIATION (instance))
{ {
tree spec = most_specialized_partial_spec (instance, tf_none); tree spec = most_specialized_partial_spec (instance, tf_none);
if (spec && TREE_VALUE (spec) == tmpl) tree inst_decl = (DECL_P (instance)
{ ? instance : TYPE_NAME (instance));
tree inst_decl = (DECL_P (instance) if (!spec)
? instance : TYPE_NAME (instance)); /* OK */;
permerror (input_location, else if (spec == error_mark_node)
"partial specialization of %qD after instantiation " permerror (input_location,
"of %qD", decl, inst_decl); "declaration of %qD ambiguates earlier template "
} "instantiation for %qD", decl, inst_decl);
else if (TREE_VALUE (spec) == tmpl)
permerror (input_location,
"partial specialization of %qD after instantiation "
"of %qD", decl, inst_decl);
} }
} }
......
// DR 2179
template <class T1, class T2> class A;
template <class T> struct A<T, void> { void f(); };
template <class T> void g(T) { A<char, void>().f(); } // #1
template<typename T> struct A<char, T> {}; // { dg-error "" }
A<char, void> f; // #2
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