[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaTemplate / unused-variables.cpp
blob1b9350b865dc0603eb55790718a2bba99956e193
1 // RUN: %clang_cc1 -fsyntax-only -Wunused -verify %s
3 struct X0 {
4 ~X0();
5 };
7 struct X1 { };
9 template<typename T>
10 void f() {
11 X0 x0;
12 X1 x1; // expected-warning{{unused variable 'x1'}}
15 template<typename T, typename U>
16 void g() {
17 T t;
18 U u; // expected-warning{{unused variable 'u'}}
21 template void g<X0, X1>(); // expected-note{{in instantiation of}}