Richard Smith | f960335 | 2011-06-21 23:07:19 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x -Wunused |
| 2 | |
| 3 | // PR9968: We used to warn that __range is unused in a dependent for-range. |
| 4 | |
| 5 | template <typename T> |
| 6 | struct Vector { |
| 7 | void doIt() { |
| 8 | // FIXME: PR10168: Only warn once for this! |
| 9 | int a; // expected-warning 2{{unused variable 'a'}} |
| 10 | |
| 11 | for (auto& e : elements) |
| 12 | ; |
| 13 | } |
| 14 | |
| 15 | T elements[10]; |
| 16 | }; |
| 17 | |
| 18 | |
| 19 | int main(int, char**) { |
| 20 | Vector<int> vector; |
| 21 | vector.doIt(); // expected-note {{requested here}} |
| 22 | } |