Commit 00e08b0f by Jason Merrill Committed by Jason Merrill

CWG 1847 - Clarifying compatibility during partial ordering

	* pt.c (more_specialized_fn): No order between two non-deducible
	parameters.

From-SVN: r247856
parent e5795ce4
2017-05-10 Jason Merrill <jason@redhat.com>
CWG 1847 - Clarifying compatibility during partial ordering
* pt.c (more_specialized_fn): No order between two non-deducible
parameters.
* pt.c (dependent_type_p): Make sure we aren't called with
global_type_node.
......
......@@ -21182,6 +21182,13 @@ more_specialized_fn (tree pat1, tree pat2, int len)
len = 0;
}
/* DR 1847: If a particular P contains no template-parameters that
participate in template argument deduction, that P is not used to
determine the ordering. */
if (!uses_deducible_template_parms (arg1)
&& !uses_deducible_template_parms (arg2))
goto next;
if (TREE_CODE (arg1) == REFERENCE_TYPE)
{
ref1 = TYPE_REF_IS_RVALUE (arg1) + 1;
......@@ -21303,6 +21310,8 @@ more_specialized_fn (tree pat1, tree pat2, int len)
These must be unordered. */
break;
next:
if (TREE_CODE (arg1) == TYPE_PACK_EXPANSION
|| TREE_CODE (arg2) == TYPE_PACK_EXPANSION)
/* We have already processed all of the arguments in our
......
// { dg-do compile { target c++11 } }
using size_t = decltype(sizeof(0));
template <class T> struct A
{
using size_type = size_t;
};
template <class T>
void f(size_t, T);
template <class T>
void f(typename A<T>::size_type, T);
int main()
{
f(1,2); // { dg-error "ambiguous" }
}
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