OSDN Git Service

PR c++/57043
[pf3gnuchains/gcc-fork.git] / gcc / cp / pt.c
index 1b9f314..ed33198 100644 (file)
@@ -14713,8 +14713,11 @@ fn_type_unification (tree fn,
 
       /* If we're looking for an exact match, check that what we got
         is indeed an exact match.  It might not be if some template
-        parameters are used in non-deduced contexts.  */
-      if (strict == DEDUCE_EXACT)
+        parameters are used in non-deduced contexts.  But don't check
+        for an exact match if we have dependent template arguments;
+        in that case we're doing partial ordering, and we already know
+        that we have two candidates that will provide the actual type.  */
+      if (strict == DEDUCE_EXACT && !any_dependent_template_arguments_p (targs))
        {
          unsigned int i;