diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/friend34.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/friend34.C | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend34.C b/gcc/testsuite/g++.old-deja/g++.pt/friend34.C new file mode 100644 index 000000000..5e80ab98b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/friend34.C @@ -0,0 +1,14 @@ +// { dg-do assemble } + +// This testcase won't fail if class ::foo is forward-declared in the +// global namespace, nor if class bar is not a template class. + +template <typename T = void> +class bar { +public: + friend class foo; // this is not bar::foo, it forward-declares ::foo + class foo {}; + bar() { foo(); } // but this should refer to bar::foo +}; + +bar<> baz; |