diff options
Diffstat (limited to 'test/CXX/class.access/class.friend/p3-cxx0x.cpp')
-rw-r--r-- | test/CXX/class.access/class.friend/p3-cxx0x.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CXX/class.access/class.friend/p3-cxx0x.cpp b/test/CXX/class.access/class.friend/p3-cxx0x.cpp index e4d5fd5..ea9d2ce 100644 --- a/test/CXX/class.access/class.friend/p3-cxx0x.cpp +++ b/test/CXX/class.access/class.friend/p3-cxx0x.cpp @@ -28,14 +28,19 @@ X1<Y2> x1a; X1<Y3> x1b; X1<Y1> x1c; // expected-note{{in instantiation of template class 'X1<Y1>' requested here}} +template<typename T> class B; + template<typename T> class A { T x; public: class foo {}; static int y; + template <typename S> friend class B<S>::ty; }; +template <typename T> class B { typedef int ty; }; + struct { // Ill-formed int friend; // expected-error {{'friend' must appear first in a non-function declaration}} @@ -53,3 +58,5 @@ struct { float; template<typename T> friend class A<T>::foo; } a; + +void testA() { (void)sizeof(A<int>); } |