]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport:
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Tue, 6 Dec 2005 11:00:46 +0000 (11:00 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Tue, 6 Dec 2005 11:00:46 +0000 (11:00 +0000)
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.

* g++.dg/overload/koenig2.C: New.

From-SVN: r108114

gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/overload/koenig2.C [new file with mode: 0644]

index e9767a957fc0807e6de4c537d9824758ecf14a2b..6d139be49ba4874fdda891ee93c64a1c75772b3f 100644 (file)
@@ -1,3 +1,12 @@
+2005-12-06  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       Backport:
+       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.
+
 2005-12-05  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        Backport:
index 7cefe2e661cfb90294c8e97dd477c95e6ff0232c..28d89e93fb20cd8b381085eb4ce5627f598dc551 100644 (file)
@@ -4433,9 +4433,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)
     {
index 919ebd5fdad7ccf3196fb26f9eeed95a473deef6..d8d2b4857d0affe8a8b6196e39cbecbb058b71da 100644 (file)
@@ -1,3 +1,11 @@
+2005-12-06  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       Backport:
+       2005-10-18  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/21383
+       * g++.dg/overload/koenig2.C: New.
+
 2005-12-05  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        Backport:
diff --git a/gcc/testsuite/g++.dg/overload/koenig2.C b/gcc/testsuite/g++.dg/overload/koenig2.C
new file mode 100644 (file)
index 0000000..f35aa1a
--- /dev/null
@@ -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" "" }
+}