public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: benko@sztaki.hu
To: gcc-gnats@gcc.gnu.org
Subject: c++/10496: erroneus suggestion in diagnostic and possible bug
Date: Fri, 25 Apr 2003 13:16:00 -0000	[thread overview]
Message-ID: <20030425130751.2623.qmail@sources.redhat.com> (raw)


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


             reply	other threads:[~2003-04-25 13:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-25 13:16 benko [this message]
2003-04-25 13:26 Gabriel Dos Reis
2003-04-25 13:56 Pal Benko
2003-04-26  6:56 Gabriel Dos Reis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030425130751.2623.qmail@sources.redhat.com \
    --to=benko@sztaki.hu \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).