Looks like a g++ bug --- apparently no namespace injection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

#include <iostream>
struct X {
  struct Node {};
  friend std::ostream& operator <<(std::ostream& out, Node*) {
    return out << "This should be printed!";
  }
};
int main () {
  std::cout << (X::Node*) 0 << "\n";
}

I think this should print out the message, but g++ version 4.1.2 and 4.3.1
both print 0. If the <<-function is placed in the global namespace,
then it works.

This looks like a bug to me.

Oliver

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux