This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10496: erroneus suggestion in diagnostic
- From: bangerth at dealii dot org
- To: benko at sztaki dot hu, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 25 Apr 2003 15:04:07 -0000
- Subject: Re: c++/10496: erroneus suggestion in diagnostic
- Reply-to: bangerth at dealii dot org, benko at sztaki dot hu, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: erroneus suggestion in diagnostic and possible bug
New Synopsis: erroneus suggestion in diagnostic
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Apr 25 15:04:06 2003
State-Changed-Why:
Confirmed. Though the example you gave is wrong (it compiles
cleanly, what you wanted is just &f). With this
---------------------------
struct X {
void f() const {
&f;
}
};
------------------------
I get indeed
g/x> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c x.cc
x.cc: In member function `void X::f() const':
x.cc:3: error: ISO C++ forbids taking the address of an unqualified non-static
member function to form a pointer to member function. Say `&const X::f'
gcc is right to require you to qualify f with the class name,
i.e. write &X::f, but the "const" in the error message is
wrong, of course.
This is a bug I see in every version 2.95 ... 3.4.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10496