summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx98-compat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/cxx98-compat.cpp')
-rw-r--r--clang/test/SemaCXX/cxx98-compat.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx98-compat.cpp b/clang/test/SemaCXX/cxx98-compat.cpp
index 830ab9b6fe4..ca32c197de7 100644
--- a/clang/test/SemaCXX/cxx98-compat.cpp
+++ b/clang/test/SemaCXX/cxx98-compat.cpp
@@ -8,6 +8,8 @@ namespace std {
initializer_list(T*, size_t);
T *p;
size_t n;
+ T *begin();
+ T *end();
};
}
@@ -103,6 +105,11 @@ void RangeFor() {
int xs[] = {1, 2, 3};
for (int &a : xs) { // expected-warning {{range-based for loop is incompatible with C++98}}
}
+ for (auto &b : {1, 2, 3}) {
+ // expected-warning@-1 {{range-based for loop is incompatible with C++98}}
+ // expected-warning@-2 {{'auto' type specifier is incompatible with C++98}}
+ // expected-warning@-3 {{initialization of initializer_list object is incompatible with C++98}}
+ }
}
struct InClassInit {
OpenPOWER on IntegriCloud