This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19403] [4.0 Regression] name lookup is broken with friends
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jan 2005 19:37:24 -0000
- Subject: [Bug c++/19403] [4.0 Regression] name lookup is broken with friends
- References: <20050112180427.19403.Woebbeking@web.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2005-01-12 19:37 -------
Subject: Re: [4.0 Regression] name lookup is broken with friends
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| : Search converges between 2004-11-25-014001-trunk (#656) and 2004-11-25-161001-trunk
| (#657).
|
| Yes this is valid code. we should have found the global A for the statement "friend struct A;" but instead
| it adds a class to the namespace Boo which is wrong.
Excuse me?
The behaviour mandated by the C++ standard is that if there is no
declaration for type A in the innermost enclosing namespace then an
implicit one is added -- because A is used unqualified. In
particular, the global A should not be found. Thus the code is
ill-formed.
The PR should be closed as invalid.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19403