blob: ce6b379cc192a2a78df7d8069c1f697dbdeabd3e [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
10 for (auto& e : elements)
11 ;
12 }
13
14 T elements[10];
15 };
16
17
18int main(int, char**) {
19 Vector<int> vector;
Richard Smithe3499ca2011-06-21 23:42:09 +000020 vector.doIt();
Richard Smithcd6f3662011-06-21 23:07:19 +000021}