2011-10-20 21:14:49 +00:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 -Wunused
|
2011-07-17 15:40:56 +00:00
|
|
|
|
|
|
|
// PR9968: We used to warn that __range is unused in a dependent for-range.
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct Vector {
|
|
|
|
void doIt() {
|
|
|
|
int a; // expected-warning {{unused variable 'a'}}
|
|
|
|
|
2013-06-10 20:45:12 +00:00
|
|
|
for (auto& e : elements) // expected-warning {{unused variable 'e'}}
|
2011-07-17 15:40:56 +00:00
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
T elements[10];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int main(int, char**) {
|
|
|
|
Vector<int> vector;
|
2013-06-10 20:45:12 +00:00
|
|
|
vector.doIt(); // expected-note {{here}}
|
2011-07-17 15:40:56 +00:00
|
|
|
}
|