Add LLVM runtime checks to build path
[clang/acc.git] / test / SemaCXX / vararg-non-pod.cpp
blob1c5fe74a154d60f8ce23bc0414c9b99bc8fabd20
1 // RUN: clang-cc -fsyntax-only -verify -fblocks %s
3 extern char version[];
5 class C {
6 public:
7 C(int);
8 void g(int a, ...);
9 static void h(int a, ...);
12 void g(int a, ...);
14 void t1()
16 C c(10);
18 g(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic function; call will abort at runtime}}
19 g(10, version);
22 void t2()
24 C c(10);
26 c.g(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic method; call will abort at runtime}}
27 c.g(10, version);
29 C::h(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic function; call will abort at runtime}}
30 C::h(10, version);
33 int (^block)(int, ...);
35 void t3()
37 C c(10);
39 block(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic block; call will abort at runtime}}
40 block(10, version);
43 class D {
44 public:
45 void operator() (int a, ...);
48 void t4()
50 C c(10);
52 D d;
54 d(10, c); // expected-warning{{Line 48: cannot pass object of non-POD type 'class C' through variadic method; call will abort at runtime}}
55 d(10, version);