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]

[Bug c++/14894] New: gcc 3.3.2 fails to diagnose access violation taking address of protected member


Gcc 3.3.2 fails to diagnose the ill-formed program below. I didn't try gcc 3.4.

$ cat t.cpp && gcc --version && gcc -c -pedantic t.cpp
struct A {
protected:
    static void foo () { }
    void bar () { }
};

struct B: A
{
    static void foobar () {
        void (*pf)() = &A::foo;
        void (A::*pm)() = &A::bar;   // ill-formed
    }
};

gcc (GCC) 3.3.2
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

-- 
           Summary: gcc 3.3.2 fails to diagnose access violation taking
                    address of protected member
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14894


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