Only produce one -Wc++98-compat warning when initializing a reference from an init list with multiple elements.
llvm-svn: 172285
diff --git a/clang/test/SemaCXX/cxx98-compat.cpp b/clang/test/SemaCXX/cxx98-compat.cpp
index 830ab9b..ca32c19 100644
--- a/clang/test/SemaCXX/cxx98-compat.cpp
+++ b/clang/test/SemaCXX/cxx98-compat.cpp
@@ -8,6 +8,8 @@
initializer_list(T*, size_t);
T *p;
size_t n;
+ T *begin();
+ T *end();
};
}
@@ -103,6 +105,11 @@
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 {