Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 -Wunused |
Richard Smith | cd6f366 | 2011-06-21 23:07:19 +0000 | [diff] [blame] | 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() { |
Richard Smith | e3499ca | 2011-06-21 23:42:09 +0000 | [diff] [blame] | 8 | int a; // expected-warning {{unused variable 'a'}} |
Richard Smith | cd6f366 | 2011-06-21 23:07:19 +0000 | [diff] [blame] | 9 | |
| 10 | for (auto& e : elements) |
| 11 | ; |
| 12 | } |
| 13 | |
| 14 | T elements[10]; |
| 15 | }; |
| 16 | |
| 17 | |
| 18 | int main(int, char**) { |
| 19 | Vector<int> vector; |
Richard Smith | e3499ca | 2011-06-21 23:42:09 +0000 | [diff] [blame] | 20 | vector.doIt(); |
Richard Smith | cd6f366 | 2011-06-21 23:07:19 +0000 | [diff] [blame] | 21 | } |