This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24986] g++ is confused when function is defined inside and outside some namespace and called with '::' prefix
- From: "relf at os2 dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Nov 2005 12:10:43 -0000
- Subject: [Bug c++/24986] g++ is confused when function is defined inside and outside some namespace and called with '::' prefix
- References: <bug-24986-1335@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from relf at os2 dot ru 2005-11-22 12:10 -------
(In reply to comment #2)
> I don't think this is a bug as what is happening is that :: is a qualified name
> and qualified namelookup (IIRC) does not find decls which are injected via
> using.
>
It does find. The following program (where `foo(long)` is commented out) is
compiled fine.
===
namespace N {
class C {};
void foo(C) {};
}
using namespace N;
/* void foo(long) {}; */
class B {
public:
/* void foo(long l) { ::foo(l); }; */
void foo(C c) { ::foo(c); };
};
int main() {
B b;
return 0;
}
===
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24986