gcc/testsuite/g++.dg/lookup/friend16.C
raw| 1 | namespace std { |
| 2 | class ostream; |
| 3 | } |
| 4 | |
| 5 | namespace N2 { |
| 6 | class C0 {}; |
| 7 | } |
| 8 | |
| 9 | std::ostream& operator<<( std::ostream& os_, const N2::C0& m_); |
| 10 | |
| 11 | namespace N1 { |
| 12 | class C1 { |
| 13 | friend std::ostream& operator<<(std::ostream& os, const C1& what); |
| 14 | }; |
| 15 | |
| 16 | class C2 { |
| 17 | friend std::ostream& operator<<(std::ostream& os, const C2& what); |
| 18 | }; |
| 19 | |
| 20 | void foo(std::ostream & os, const N2::C0& m) |
| 21 | { |
| 22 | os << m; // Is this line valid? |
| 23 | } |
| 24 | } |