This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33468] C++: Invalid interpretation of friendness with nested classes
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Sep 2007 18:59:44 -0000
- Subject: [Bug c++/33468] C++: Invalid interpretation of friendness with nested classes
- References: <bug-33468-11160@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from bangerth at dealii dot org 2007-09-18 18:59 -------
Confirmed.
A simpler to understand testcase is this one (all crud removed):
-----------------
class A {
class B { };
friend class X;
};
class X {
A::B mx;
class Y : A::B {
A::B my;
};
};
----------------
It shouldn't compile because X::Y is not a friend and therefore can't
access A::B in the declaration of 'my', as noted in 11.4/2.
This is a regression introduced in gcc 4.0.x. We get the correct error
in everything leading up to 4.0.3, but not any more in 4.0.4. This
may help figure out which patch is at fault...
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |accepts-invalid
Known to fail| |4.0.4 4.1.0 4.2.0
Known to work| |3.3.5 3.4.6 4.0.0 4.0.2
| |4.0.3
Last reconfirmed|0000-00-00 00:00:00 |2007-09-18 18:59:43
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33468