From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4999 invoked by alias); 25 Apr 2003 13:16: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 4977 invoked by uid 71); 25 Apr 2003 13:16:00 -0000 Resent-Date: 25 Apr 2003 13:16:00 -0000 Resent-Message-ID: <20030425131600.4976.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, benko@sztaki.hu Received: (qmail 2624 invoked by uid 48); 25 Apr 2003 13:07:51 -0000 Message-Id: <20030425130751.2623.qmail@sources.redhat.com> Date: Fri, 25 Apr 2003 13:16:00 -0000 From: benko@sztaki.hu Reply-To: benko@sztaki.hu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10496: erroneus suggestion in diagnostic and possible bug X-SW-Source: 2003-04/txt/msg01088.txt.bz2 List-Id: >Number: 10496 >Category: c++ >Synopsis: erroneus suggestion in diagnostic and possible bug >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Apr 25 13:16:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: benko@sztaki.hu >Release: 3.2.3 >Organization: >Environment: Linux arta 2.4.18 #2 Thu Feb 28 19:27:45 CET 2002 i686 unknown >Description: Given the following program: arta:~/c/proba$ cat ptr2mem.cc struct a { int f() const; }; int a::f() const { int (a::* b)() const = &a::f; } arta:~/c/proba$ g++3 -v Reading specs from /gml/shared/gcc-3.2.3/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/specs Configured with: ../gcc-3.2.3/configure --prefix=/gml/shared/gcc-3.2.3 Thread model: posix gcc version 3.2.3 arta:~/c/proba$ g++3 ptr2mem.cc ptr2mem.cc: In member function `int a::f() const': ptr2mem.cc:10: ISO C++ forbids taking the address of an unqualified non-static member function to form a pointer to member function. Say `&const a::f' zsh: exit 1 g++3 ptr2mem.cc arta:~/c/proba$ I think &f should be enough, but &const a::f (as suggested by the diagnostics) is refused by g++ (I think rightly so). (&a::f is accepted.) >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: