public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/2949: incorrect Koenig lookup of friend functions
@ 2001-05-25 15:46 Jens.Maurer
0 siblings, 0 replies; only message in thread
From: Jens.Maurer @ 2001-05-25 15:46 UTC (permalink / raw)
To: gcc-gnats; +Cc: rwgk, abrahams
>Number: 2949
>Category: c++
>Synopsis: incorrect Koenig lookup of friend functions
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Fri May 25 15:46:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Jens Maurer
>Release: gcc version 3.0 20010521 (prerelease)
>Organization:
>Environment:
Linux 2.4.4
glibc 2.2.3
>Description:
The attached program is accepted, although the C++ standard
clearly specifies in section 3.4.2p3 second bullet that
only "friend functions declared in associated classes"
are visible to argument-dependent lookup.
However, N::X is not an associated class.
Also erroneously accepted by
gcc version 3.1 20010518 (experimental)
See also core issue 143 for a related clarification.
>How-To-Repeat:
namespace N {
struct A { };
struct X {
friend void f(A) { }
};
}
int main()
{
N::A a;
f(a); // must not find N::f(A)
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-05-25 15:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-25 15:46 c++/2949: incorrect Koenig lookup of friend functions Jens.Maurer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).