From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32026 invoked by alias); 26 Dec 2001 22:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 31978 invoked by uid 71); 26 Dec 2001 22:36:00 -0000 Resent-Date: 26 Dec 2001 22:36:00 -0000 Resent-Message-ID: <20011226223600.31977.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, jianhua.zhou@informix.com Received:(qmail 31495 invoked by uid 61); 26 Dec 2001 22:32:26 -0000 Message-Id:<20011226223226.31494.qmail@sources.redhat.com> Date: Wed, 26 Dec 2001 14:36:00 -0000 From: jianhua.zhou@informix.com Reply-To: jianhua.zhou@informix.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/5197: compiler doesn't work correctly X-SW-Source: 2001-12/txt/msg01128.txt.bz2 List-Id: >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 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: