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


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