This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/5197: compiler doesn't work correctly
- From: jianhua dot zhou at informix dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 26 Dec 2001 22:32:26 -0000
- Subject: c++/5197: compiler doesn't work correctly
- Reply-to: jianhua dot zhou at informix dot com
>Number: 5197
>Category: c++
>Synopsis: compiler doesn't work correctly
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 26 14:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Jianhua Zhou
>Release: g++ 3.0
>Organization:
>Environment:
RedHat Linux 7.0
>Description:
Cannot solve the overloaded member function.
>How-To-Repeat:
Compile this program will give you the error message.
This file can be compile and linked on RedHat Linux 6.?,
which have the old version of "g++".
The file:
#include <iostream.h>
class Param
{
public:
Param( int v) { value = v ; } ;
int value ;
};
class Test
{
public:
static int myFunc( const Param& k ) { return k.value ; };
static int myFunc( const int& k ) { return k ; };
} ;
static int sfunc( int(*f)(const Param& k), const Param &t )
{
return (*f)( t) ;
}
int
main()
{
int ret ;
Param param(11) ;
ret = sfunc( Test::myFunc, Param(12)) ;
cout << "ret=" << ret << endl ;
return 0 ;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: