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