tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also overloaded.
authorNathan Sidwell <nathan@codesourcery.com>
Mon, 30 Sep 2002 19:33:06 +0000 (19:33 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 30 Sep 2002 19:33:06 +0000 (19:33 +0000)
cp:
* tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also
overloaded.
testsuite:
* g++.dg/overload/member1.C: New test.

From-SVN: r57662

gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/overload/member1.C [new file with mode: 0644]

index c3690f3..e6ea3fe 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-30  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also
+       overloaded.
+
 2002-09-30  Steve Ellcey  <sje@cup.hp.com>
 
        * class.c (build_vtbl_initializer): Add cast.
index 588b710..4b1142b 100644 (file)
@@ -1012,9 +1012,10 @@ really_overloaded_fn (x)
     x = TREE_OPERAND (x, 1);
   if (BASELINK_P (x))
     x = BASELINK_FUNCTIONS (x);
-  return (TREE_CODE (x) == OVERLOAD 
-         && (OVL_CHAIN (x)
-             || DECL_FUNCTION_TEMPLATE_P (OVL_FUNCTION (x))));
+  
+  return ((TREE_CODE (x) == OVERLOAD && OVL_CHAIN (x))
+         || DECL_FUNCTION_TEMPLATE_P (OVL_CURRENT (x))
+         || TREE_CODE (x) == TEMPLATE_ID_EXPR);
 }
 
 /* Return the OVERLOAD or FUNCTION_DECL inside FNS.  FNS can be an
index d444eea..2a84ea8 100644 (file)
@@ -1,3 +1,7 @@
+2002-09-30  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * g++.dg/overload/member1.C: New test.
+
 2002-09-30  Mark Mitchell  <mark@codesourcery.com>
 
        * g++.dg/abi/empty7.C: New test.
diff --git a/gcc/testsuite/g++.dg/overload/member1.C b/gcc/testsuite/g++.dg/overload/member1.C
new file mode 100644 (file)
index 0000000..29896a5
--- /dev/null
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Sep 2002 <nathan@codesourcery.com>
+
+struct X
+{
+  template<typename T> static void ProcessProxy ();
+  typedef void (*Callback) ();
+  void Process (Callback);
+  
+  template<typename T> void Process ()
+  {
+    Process (&ProcessProxy<T>);
+  }
+  
+};
+
+void foo (X *x)
+{
+  x->Process<int> ();
+}