diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c3690f3dca1bc7ae987764dba5886a8dbe3c86f2..e6ea3fe23064eba1df3850e4dba6093303ccb9bb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 588b7108095e4acafbc9c36a066ac26b7c1acc0f..4b1142b11545a62851892cb6b2e7d888ba4ddd80 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d444eea27d5605fe5f380a3514b23dee8621b223..2a84ea84780a69735bb164bc3340c639ee1bc3f0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000000000000000000000000000000000000..29896a5110fafb5441f5a5435e93c2e520954dc8 --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/member1.C @@ -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> (); +}