blob: d51ba09835d27e0af3301d09bdfb9f6022d5487a [file] [log] [blame]
Richard Smith9ca5c422011-10-13 22:29:44 +00001// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
Douglas Gregor253cadf2011-05-21 16:27:21 +00002
3struct X1 {
4 X1();
5};
6
7struct X2 {
8 X2();
9 ~X2();
10};
11
12void vararg(...);
13
14void f(X1 x1, X2 x2) {
15 vararg(x1); // okay
16 vararg(x2); // expected-error{{cannot pass object of non-trivial type 'X2' through variadic function; call will abort at runtime}}
17}
Douglas Gregor7e1aa5b2011-10-14 20:34:19 +000018
19
20namespace PR11131 {
21 struct S;
22
23 S &getS();
24
25 void f(...);
26
27 void g() {
28 (void)sizeof(f(getS()));
29 }
30}