+2008-04-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35986
+ * pt.c (more_specialized_fn): Stop the loop even if there are no
+ arguments before ellipsis.
+
2008-04-29 Jakub Jelinek <jakub@redhat.com>
PR c++/35650
processing_template_decl++;
- while (len--)
+ while (len--
+ /* Stop when an ellipsis is seen. */
+ && args1 != NULL_TREE && args2 != NULL_TREE)
{
tree arg1 = TREE_VALUE (args1);
tree arg2 = TREE_VALUE (args2);
args1 = TREE_CHAIN (args1);
args2 = TREE_CHAIN (args2);
-
- /* Stop when an ellipsis is seen. */
- if (args1 == NULL_TREE || args2 == NULL_TREE)
- break;
}
processing_template_decl--;
+2008-04-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35986
+ * g++.dg/overload/template4.C: New test.
+
2008-04-30 Kai Tietz <kai.tietz@onevision.com>
* gfortran.dg/chmod_1.f90: Disable for x86_64-*-mingw*.
--- /dev/null
+// PR c++/35986
+// { dg-do compile }
+
+namespace
+{
+ template <int> void foo (...); // { dg-error "" "candidate" }
+ template <int> void bar (int, ...); // { dg-error "" "candidate" }
+ void baz (...); // { dg-error "" "candidate" }
+}
+
+template <int> void foo (...); // { dg-error "" "candidate" }
+template <int> void bar (int, ...); // { dg-error "" "candidate" }
+void baz (...); // { dg-error "" "candidate" }
+
+void
+test ()
+{
+ foo <0> (0); // { dg-error "is ambiguous" }
+ bar <1> (0, 1); // { dg-error "is ambiguous" }
+ baz (0); // { dg-error "is ambiguous" }
+}