This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14894] New: gcc 3.3.2 fails to diagnose access violation taking address of protected member
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Apr 2004 18:15:27 -0000
- Subject: [Bug c++/14894] New: gcc 3.3.2 fails to diagnose access violation taking address of protected member
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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