blob: d413335243ef94ed104a58a27e3c409f9fb784cf [file] [log] [blame]
Anders Carlsson906fed02009-01-13 05:48:52 +00001// RUN: clang -fsyntax-only -verify -fblocks %s
2
3class C {
4public:
5 C(int);
6 void g(int a, ...);
7 static void h(int a, ...);
8};
9
10void g(int a, ...);
11
12void t1()
13{
14 C c(10);
15
16 g(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic function; call will abort at runtime}}
17}
18
19void t2()
20{
21 C c(10);
22
23 c.g(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic method; call will abort at runtime}}
24
25 C::h(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic function; call will abort at runtime}}
26}
27
28int (^block)(int, ...);
29
30void t3()
31{
32 C c(10);
33
34 block(10, c); // expected-warning{{cannot pass object of non-POD type 'class C' through variadic block; call will abort at runtime}}
35}
36
37class D {
38public:
39 void operator() (int a, ...);
40};
41
42void t4()
43{
44 C c(10);
45
46 D d;
47
48 d(10, c); // expected-warning{{Line 48: cannot pass object of non-POD type 'class C' through variadic method; call will abort at runtime}}
49}