public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/3926: Trouble with namespaces
@ 2001-08-03 10:16 reichelt
0 siblings, 0 replies; 2+ messages in thread
From: reichelt @ 2001-08-03 10:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 3926
>Category: c++
>Synopsis: Trouble with namespaces
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Fri Aug 03 10:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Volker Reichelt
>Release: gcc 2.95.3, gcc 3.0
>Organization:
>Environment:
i686-pc-linux-gnu, mips-sgi-irix6.5
>Description:
The following illegal code (the function "f" should not
be visible in thge global namespace) compiles without
errors using g++ 3.0 or 2.95.3:
namespace ZZZ
{
struct T {};
void f (T) {}
}
void g() { ZZZ::T x; f(x); }
The bug seems to be platform independant and
might be related to PR 2127.
>How-To-Repeat:
g++ -c Bug.cpp
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/3926: Trouble with namespaces
@ 2001-08-03 10:34 pme
0 siblings, 0 replies; 2+ messages in thread
From: pme @ 2001-08-03 10:34 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, reichelt
Synopsis: Trouble with namespaces
State-Changed-From-To: open->closed
State-Changed-By: pme
State-Changed-When: Fri Aug 3 10:34:38 2001
State-Changed-Why:
Thank you for your bug report.
Not only is this /not/ a bug in the compiler, the example
you give is almost identical to the one given in the ISO
C++ standard, when they explain why such code must work
this way.
This is called argument-dependant name lookup, or "Koenig
lookup," described in [3.4.2]. The code you gave is
almost an exact duplicate of the example in [3.4.2]/2.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3926&database=gcc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-08-03 10:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-03 10:16 c++/3926: Trouble with namespaces reichelt
2001-08-03 10:34 pme
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).