This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/4047: assuming & on overloaded member functions
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/4047: assuming & on overloaded member functions
- From: yuzhang at ca dot ibm dot com
- Date: 17 Aug 2001 17:13:42 -0000
- Reply-To: yuzhang at ca dot ibm dot com
>Number: 4047
>Category: c++
>Synopsis: assuming & on overloaded member functions
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Aug 17 10:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Yu Zhang
>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();
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: