This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

c++/5197: compiler doesn't work correctly



>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:


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