summaryrefslogtreecommitdiffstats
path: root/test/CXX/class.access/class.friend/p2-cxx03.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/class.access/class.friend/p2-cxx03.cpp')
-rw-r--r--test/CXX/class.access/class.friend/p2-cxx03.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/CXX/class.access/class.friend/p2-cxx03.cpp b/test/CXX/class.access/class.friend/p2-cxx03.cpp
index f8cabfd..88b2ea3 100644
--- a/test/CXX/class.access/class.friend/p2-cxx03.cpp
+++ b/test/CXX/class.access/class.friend/p2-cxx03.cpp
@@ -1,7 +1,14 @@
// 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
template<typename T>
class X0 {
- friend T; // expected-warning{{non-class friend type 'T' is a C++11 extension}}
+ friend T;
+#if __cplusplus <= 199711L // C++03 or earlier modes
+ // expected-warning@-2{{non-class friend type 'T' is a C++11 extension}}
+#else
+ // expected-no-diagnostics
+#endif
};
class X1 { };
OpenPOWER on IntegriCloud