Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.pt/friend34.C

raw
1 // { dg-do assemble }
2
3 // This testcase won't fail if class ::foo is forward-declared in the
4 // global namespace, nor if class bar is not a template class.
5
6 template <typename T = void>
7 class bar {
8 public:
9 friend class foo; // this is not bar::foo, it injects hidden ::foo
10 class foo {};
11 bar() { foo(); } // but this should refer to bar::foo
12 };
13
14 bar<> baz;
15
16 // We still have not made foo visible.
17 foo *b; // { dg-error "does not name a type" }