summaryrefslogtreecommitdiff
path: root/clang/test/CXX/class/class.friend/p2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/class/class.friend/p2.cpp')
-rw-r--r--clang/test/CXX/class/class.friend/p2.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/CXX/class/class.friend/p2.cpp b/clang/test/CXX/class/class.friend/p2.cpp
new file mode 100644
index 0000000..fb3cd19
--- /dev/null
+++ b/clang/test/CXX/class/class.friend/p2.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct B0;
+
+class A {
+ friend class B {}; // expected-error {{cannot define a type in a friend declaration}}
+ friend int; // expected-warning {{non-class friend type 'int' is a C++11 extension}}
+ friend B0; // expected-warning {{specify 'struct' to befriend 'B0'}}
+ friend class C; // okay
+};