This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/10496: erroneus suggestion in diagnostic


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]