diff options
author | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 056abd2059c65a3e908193aeae16fad98017437c (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/CXX/class.access/class.friend/p3-cxx0x.cpp | |
parent | cc73504950eb7b5dff2dded9bedd67bc36d64641 (diff) | |
download | FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz |
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
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 00fc0a3..e4d5fd5 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; |