From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10207 invoked by alias); 25 Apr 2003 13:26:02 -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 10155 invoked by uid 71); 25 Apr 2003 13:26:01 -0000 Date: Fri, 25 Apr 2003 13:26:00 -0000 Message-ID: <20030425132601.10154.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Gabriel Dos Reis Subject: Re: c++/10496: erroneus suggestion in diagnostic and possible bug Reply-To: Gabriel Dos Reis X-SW-Source: 2003-04/txt/msg01089.txt.bz2 List-Id: The following reply was made to PR c++/10496; it has been noted by GNATS. From: Gabriel Dos Reis To: benko@sztaki.hu Cc: gcc-gnats@gcc.gnu.org Subject: Re: c++/10496: erroneus suggestion in diagnostic and possible bug Date: 25 Apr 2003 15:16:24 +0200 benko@sztaki.hu writes: [...] | 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' Odd. | I think &f should be enough, but &const a::f No, "&f" is no good and "&const a::f" is weird and plain dead wrong. "&a::f" is good. | (as suggested by the diagnostics) is refused by g++ | (I think rightly so). | | (&a::f is accepted.) But isn't what you wrote in your testcase? Sometime is odd about it. -- Gaby