summaryrefslogtreecommitdiff
path: root/test/CXX/class/class.friend/p2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/class/class.friend/p2.cpp')
-rw-r--r--test/CXX/class/class.friend/p2.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/CXX/class/class.friend/p2.cpp b/test/CXX/class/class.friend/p2.cpp
index fb3cd19b2b18..e4a46b30e788 100644
--- a/test/CXX/class/class.friend/p2.cpp
+++ b/test/CXX/class/class.friend/p2.cpp
@@ -1,10 +1,18 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %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 int;
+#if __cplusplus <= 199711L
+ // expected-warning@-2 {{non-class friend type 'int' is a C++11 extension}}
+#endif
+ friend B0;
+#if __cplusplus <= 199711L
+ // expected-warning@-2 {{unelaborated friend declaration is a C++11 extension; specify 'struct' to befriend 'B0'}}
+#endif
friend class C; // okay
};