diff options
Diffstat (limited to 'test/CXX/class/class.friend/p2.cpp')
-rw-r--r-- | test/CXX/class/class.friend/p2.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CXX/class/class.friend/p2.cpp b/test/CXX/class/class.friend/p2.cpp new file mode 100644 index 0000000000000..98be2049e7566 --- /dev/null +++ b/test/CXX/class/class.friend/p2.cpp @@ -0,0 +1,10 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +struct B0; + +class A { + friend class B {}; // expected-error {{cannot define a type in a friend declaration}} + friend int; // expected-error {{friends can only be classes or functions}} + friend B0; // expected-error {{must specify 'struct' to befriend}} + friend class C; // okay +}; |