xref: /llvm-project/clang/test/SemaCXX/warn-unused-variables.cpp (revision 6aa503900f17e9266b02ce4092c5df6d859dc4c2)
1 // RUN: clang -fsyntax-only -Wunused-variable -verify %s
2 
3 template<typename T> void f() {
4 	T t;
5 	t = 17;
6 }
7 
8 // PR5407
9 struct A { A(); };
10 struct B { ~B(); };
11 void f() {
12   A a;
13   B b;
14 }
15 
16 // PR5531
17 namespace PR5531 {
18   struct A {
19   };
20 
21   struct B {
22     B(int);
23   };
24 
25   struct C {
26     ~C();
27   };
28 
29   void test() {
30     A();
31     B(17);
32     C();
33   }
34 }
35