aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-04-30 16:24:18 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-04-30 16:24:18 +0200
commit56b1a55446a0646c53a2474be6051acf592e1da7 (patch)
tree6f42f93af03d5aa653deb3fc9cdc0674829d7621 /gcc/cp
parent5856b807fddfa9bd4b4a7b22dd0e1279eea795d4 (diff)
downloadgcc-56b1a55446a0646c53a2474be6051acf592e1da7.zip
gcc-56b1a55446a0646c53a2474be6051acf592e1da7.tar.gz
gcc-56b1a55446a0646c53a2474be6051acf592e1da7.tar.bz2
re PR c++/35986 (ICE with ambiguous template functions)
PR c++/35986 * pt.c (more_specialized_fn): Stop the loop even if there are no arguments before ellipsis. * g++.dg/overload/template4.C: New test. From-SVN: r134823
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bb4c4af..5289222 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 5ea5128..b13573c 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -13652,7 +13652,9 @@ more_specialized_fn (tree pat1, tree pat2, int len)
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);
@@ -13815,10 +13817,6 @@ more_specialized_fn (tree pat1, tree pat2, int len)
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--;