[Bug c++/14894] New: gcc 3.3.2 fails to diagnose access violation taking address of protected member
sebor at roguewave dot com
gcc-bugzilla@gcc.gnu.org
Thu Apr 8 18:15:00 GMT 2004
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
More information about the Gcc-bugs
mailing list