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: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Nov 2005 05:31:51 -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 #4 from bangerth at dealii dot org 2005-11-23 05:31 -------
I don't have chapter and verse to justify this, but icc and gcc agree
that they should reject this code
--------------
namespace N {
class C {};
void foo(C) {};
}
using namespace N;
void foo(long) {};
void bar() { C c; ::foo(c); };
---------------------
while they both accept the code with ::foo(long) removed:
---------------------
namespace N {
class C {};
void foo(C) {};
}
using namespace N;
void bar() { C c; ::foo(c); };
---------------------
One may certainly be tempted to find this confusing.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24986