diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-30 14:24:18 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-30 14:24:18 +0000 |
commit | c1f194edce3cf8c485367024be8cef780be2a854 (patch) | |
tree | 6f42f93af03d5aa653deb3fc9cdc0674829d7621 /gcc/cp | |
parent | 2c7ebcb7d403aaca39aae87472f61d9a131c9237 (diff) | |
download | gcc-c1f194edce3cf8c485367024be8cef780be2a854.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134823 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bb4c4af0b4a..52892226720 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 5ea5128e871..b13573ce43c 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--; |