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.
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;
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
--- /dev/null
+// { 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" }
+}