xref: /minix3/external/bsd/llvm/dist/clang/test/SemaTemplate/unused-variables.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -Wunused -verify %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc struct X0 {
4*f4a2713aSLionel Sambuc   ~X0();
5*f4a2713aSLionel Sambuc };
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc struct X1 { };
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc template<typename T>
f()10*f4a2713aSLionel Sambuc void f() {
11*f4a2713aSLionel Sambuc   X0 x0;
12*f4a2713aSLionel Sambuc   X1 x1; // expected-warning{{unused variable 'x1'}}
13*f4a2713aSLionel Sambuc }
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc template<typename T, typename U>
g()16*f4a2713aSLionel Sambuc void g() {
17*f4a2713aSLionel Sambuc   T t;
18*f4a2713aSLionel Sambuc   U u; // expected-warning{{unused variable 'u'}}
19*f4a2713aSLionel Sambuc }
20*f4a2713aSLionel Sambuc 
21*f4a2713aSLionel Sambuc template void g<X0, X1>(); // expected-note{{in instantiation of}}
22