[Bug c++/24986] g++ is confused when function is defined inside and outside some namespace and called with '::' prefix
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Wed Nov 23 05:31:00 GMT 2005
------- 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
More information about the Gcc-bugs
mailing list