This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/4047: assuming & on overloaded member functions


Hi,

I've just submitted a bug report c++/4047. I'm wondering if anybody else
has encountered the same problem before. Is there any quick fix for 2.95.x?

Thanks.
------------------------------------------------------------
>Release:        2.95.2, 2.95.3
>Organization:
>Environment:
suse7.0, suse7.2
>Description:
when we use an overloaded static member function as
another function's input argument, g++ report "assuming
& on overloaded member functions".

This bug does not appear in GCC3.0, though I haven't seen a
similar bug report before.
>How-To-Repeat:
#include <stdio.h>

typedef int (*COMPTR) (char*, void*);

class Component
{
  public:

  static int foo(char* str, void* ptr)
  {
    return 888;
  };

  static int foo(int x)
  {
    return -x;
  };
};

class Server
{
  public:

  void use(COMPTR func)
  {
    printf("%i\n",func("1234", NULL));
  };

};

Server server;

template<class T>
class User
{
  public:

  void call()
  {
    server.use(T::foo);
  };


};


int main()
{
  User<Component> uc;
  uc.call();
}
------------------------------------------------------------

------------
Yu Zhang
02/0CW1/4611/BURN
IBM Canada Pacific Development Centre(PDC)
4611 Canada  Way, Burnaby, B.C. Canada V5G 4X3
Phone: (604) 297-3108  Fax:(604)297-3020
E-mail: yuzhang@ca.ibm.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]