This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/7809: g++ 3.2 accepts friend declarations concerning inaccessible methods
- From: bagnara at cs dot unipr dot it
- To: gcc-gnats at gcc dot gnu dot org
- Date: 2 Sep 2002 13:36:10 -0000
- Subject: c++/7809: g++ 3.2 accepts friend declarations concerning inaccessible methods
- Reply-to: bagnara at cs dot unipr dot it
>Number: 7809
>Category: c++
>Synopsis: g++ 3.2 accepts friend declarations concerning inaccessible methods
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Mon Sep 02 06:46:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: bagnara@cs.unipr.it
>Release: unknown-1.0
>Organization:
>Environment:
$ uname -a
Linux zoltan.unisuv.it 2.4.19 #23 Sun Aug 4 18:03:23 CEST 2002 i686 unknown
$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ../gcc-3.2/configure --prefix=/usr/local
Thread model: posix
gcc version 3.2
>Description:
The following snippet (call it bug.cc) compiles
whereas, according to the standard (11p3 and 11.4p7),
it should not:
class A {
private:
void f();
public:
A();
};
class B {
friend void A::f();
};
>How-To-Repeat:
$ g++ -c -W -Wall bug.cc
$
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: