aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-typeof.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Parser/cxx-typeof.cpp')
-rw-r--r--test/Parser/cxx-typeof.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Parser/cxx-typeof.cpp b/test/Parser/cxx-typeof.cpp
index 1ec6e29b1311..c9651b4e1cd7 100644
--- a/test/Parser/cxx-typeof.cpp
+++ b/test/Parser/cxx-typeof.cpp
@@ -1,4 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++98 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s
static void test() {
int *pi;
@@ -9,5 +11,10 @@ static void test() {
// Part of rdar://problem/8347416; from the gcc test suite.
struct S {
int i;
- __typeof(S::i) foo(); // expected-error {{invalid use of non-static data member 'i'}}
+ __typeof(S::i) foo();
+#if __cplusplus <= 199711L
+ // expected-error@-2 {{invalid use of non-static data member 'i'}}
+#else
+ // expected-no-diagnostics
+#endif
};