2011-06-22 07:07:19 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x -Wunused
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
for (auto& e : elements)
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
T elements[10];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int main(int, char**) {
|
|
|
|
Vector<int> vector;
|
2011-06-22 07:42:09 +08:00
|
|
|
vector.doIt();
|
2011-06-22 07:07:19 +08:00
|
|
|
}
|