blob: ec11015552e73c699ec8ef67d13e11ac20be6a5a [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 -Wunused
Richard Smithcd6f3662011-06-21 23:07:19 +00002
3// PR9968: We used to warn that __range is unused in a dependent for-range.
4
5template <typename T>
6 struct Vector {
7 void doIt() {
Richard Smithe3499ca2011-06-21 23:42:09 +00008 int a; // expected-warning {{unused variable 'a'}}
Richard Smithcd6f3662011-06-21 23:07:19 +00009
Richard Smithdc7a4f52013-04-30 13:56:41 +000010 for (auto& e : elements) // expected-warning {{unused variable 'e'}}
Richard Smithcd6f3662011-06-21 23:07:19 +000011 ;
12 }
13
14 T elements[10];
15 };
16
17
18int main(int, char**) {
19 Vector<int> vector;
Richard Smithdc7a4f52013-04-30 13:56:41 +000020 vector.doIt(); // expected-note {{here}}
Richard Smithcd6f3662011-06-21 23:07:19 +000021}