blob: 5620248f5005f9fe82b18cac0e0a560141f8aed3 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang -fsyntax-only -Wunused-variable -verify %s
2
3template<typename T> void f() {
4 T t;
5 t = 17;
6}
7
8// PR5407
9struct A { A(); };
10struct B { ~B(); };
11void f() {
12 A a;
13 B b;
14}
15
16// PR5531
17namespace 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
36
37struct X {
38 int foo() __attribute__((warn_unused_result));
39};
40
41void bah() {
42 X x, *x2;
43 x.foo(); // expected-warning {{ignoring return value of function declared with warn_unused_result attribute}}
44 x2->foo(); // expected-warning {{ignoring return value of function declared with warn_unused_result attribute}}
45}