This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/1016] [DR 166] friend class declarations not observing namespace rules.
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Nov 2004 16:31:54 -0000
- Subject: [Bug c++/1016] [DR 166] friend class declarations not observing namespace rules.
- References: <20001207214600.1016.jaycox@gimp.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-11-26 16:31 -------
Kriang, according to your comment in #6 the original example should
compile, right?
And the following example should generate an error in line 12 since
the global class b is not a friend of foo::a, right?
=====================================
class b { void bar(); };
namespace foo
{
class a
{
friend class b;
b b_;
};
}
void b::bar() { foo::a().b_; }
=====================================
In this case we have a rejects-valid on mainline for the example in
comment #1. And an accepts-invalid for the example in this comment
for gcc 2.95.3 - 3.4.3.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1016