This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/24986] g++ is confused when function is defined inside and outside some namespace and called with '::' prefix



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]