diff options
author | nathan <> | 2005-10-18 12:45:23 +0000 |
---|---|---|
committer | nathan <> | 2005-10-18 12:45:23 +0000 |
commit | 288608c04479a86c5c50b51d24c56262f1e1b2e4 (patch) | |
tree | 85ecd5f1d7feccfd509975da7f7a589016bcb368 | |
parent | a081bd34b39d51209f422ccf0b2f021ecea31e9a (diff) |
cp:
PR c++/21383
* name-lookup.c (arg_assoc): Template args can be null in a
template-id-expr.
testsuite:
PR c++/21383
* g++.dg/overload/koenig2.C: New.
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/overload/koenig2.C | 15 |
4 files changed, 26 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cd3cded707a..42dc317095d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2005-10-18 Nathan Sidwell <nathan@codesourcery.com> + PR c++/21383 + * name-lookup.c (arg_assoc): Template args can be null in a + template-id-expr. + PR c++/22604 * class.c (update_vtable_entry_for_fn): Don't process invalid covariant overriders. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 29e5f2b2be6..13d789b1f56 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4594,9 +4594,10 @@ arg_assoc (struct arg_lookup *k, tree n) return true; /* Now the arguments. */ - for (ix = TREE_VEC_LENGTH (args); ix--;) - if (arg_assoc_template_arg (k, TREE_VEC_ELT (args, ix)) == 1) - return true; + if (args) + for (ix = TREE_VEC_LENGTH (args); ix--;) + if (arg_assoc_template_arg (k, TREE_VEC_ELT (args, ix)) == 1) + return true; } else if (TREE_CODE (n) == OVERLOAD) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ce6dd03c082..54122c1dbab 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2005-10-18 Nathan Sidwell <nathan@codesourcery.com> + PR c++/21383 + * g++.dg/overload/koenig2.C: New. + PR c++/23118 * g++.dg/overload/error2.C: New. diff --git a/gcc/testsuite/g++.dg/overload/koenig2.C b/gcc/testsuite/g++.dg/overload/koenig2.C new file mode 100644 index 00000000000..f35aa1a31b6 --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/koenig2.C @@ -0,0 +1,15 @@ +// Copyright (C) 2005 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 18 Oct 2005 <nathan@codesourcery.com> + +// PR 21383 +// Origin: Matthew Hall <mahall@ncsa.uiuc.edu> + +template <class T> +void dummy(T& t); + +void anyfunc(int x); + +void Foo () +{ + anyfunc (&dummy<>); // { dg-error "cannot resolve overload" "" } +} |