From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3899 invoked by alias); 9 Jan 2002 23:56: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 3870 invoked by uid 71); 9 Jan 2002 23:56:01 -0000 Resent-Date: 9 Jan 2002 23:56:01 -0000 Resent-Message-ID: <20020109235601.3869.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 29671 invoked by uid 61); 9 Jan 2002 23:50:03 -0000 Message-Id:<20020109235003.29670.qmail@sources.redhat.com> Date: Wed, 09 Jan 2002 15:56: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++/5340: compilation problem X-SW-Source: 2002-01/txt/msg00390.txt.bz2 List-Id: >Number: 5340 >Category: c++ >Synopsis: compilation problem >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Jan 09 15:56:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Jianhua Zhou >Release: g++ 2.9.6 >Organization: >Environment: RedHat 7.1 >Description: Compile this program with g++ 2.9.6 and on RedHat 7.1 gives an error to me. This file can be compile and linked on RedHat Linux 6.2, which have the "g++" 2.9.1. #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 ; } This file is ok on 3.0.3. But we 3.0.3 is ANSI C++ standard version, and we are using some features which ANSI C++ no longer supported. So we have to use g++ 2.9.X version. Thanks! >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: