diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 13cc256e404620c1de0cbcc4e43ce1e2dbbc4898 (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/CXX/class.access/class.friend/p3-cxx0x.cpp | |
parent | 657bc3d9848e3be92029b2416031340988cd0111 (diff) |
Notes
Diffstat (limited to 'test/CXX/class.access/class.friend/p3-cxx0x.cpp')
-rw-r--r-- | test/CXX/class.access/class.friend/p3-cxx0x.cpp | 26 |
1 files changed, 26 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 00fc0a33bef2..e4d5fd55b0b6 100644 --- a/test/CXX/class.access/class.friend/p3-cxx0x.cpp +++ b/test/CXX/class.access/class.friend/p3-cxx0x.cpp @@ -27,3 +27,29 @@ struct Y3 { X1<Y2> x1a; X1<Y3> x1b; X1<Y1> x1c; // expected-note{{in instantiation of template class 'X1<Y1>' requested here}} + +template<typename T> +class A { + T x; +public: + class foo {}; + static int y; +}; + +struct { + // Ill-formed + int friend; // expected-error {{'friend' must appear first in a non-function declaration}} + unsigned friend int; // expected-error {{'friend' must appear first in a non-function declaration}} + const volatile friend int; // expected-error {{'friend' must appear first in a non-function declaration}} + int + friend; // expected-error {{'friend' must appear first in a non-function declaration}} + + // OK + int friend foo(void); + friend int; + friend const volatile int; + friend + + float; + template<typename T> friend class A<T>::foo; +} a; |