2 // { dg-skip-if "requires hosted libstdc++ for iostream" { ! hostedlib } }
4 // Copyright (C) 2002 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 24 Dec 2002 <nathan@codesourcery.com>
7 // PR 5116. template instantiation can add a friend into a namespace,
8 // and thus change overload resolution.
17 template <typename T>struct Handle
21 operator bool() const { wrong++; return true; }
23 friend std::ostream& operator<<(std::ostream& ostr, const Handle& r)
27 return ostr << "in operator<<(ostream&, const Handle&)";
31 typedef Handle<Buggy> Buggy_h;
33 bool cmp (const Buggy_h& b1, const Buggy_h& b2)
35 std::cout << b1 << " " << b2 << std::endl;
45 return !(right == 2 && !wrong);