42 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs2// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs -std=c++983// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs -std=c++114 5#if __cplusplus > 199711L6// expected-no-diagnostics7#endif8 9extern char version[];10 11@protocol P;12 13class C {14public:15 C(int);16};17 18@interface D 19- (void)g:(int)a, ...;20@end21 22void t1(D *d)23{24 C c(10);25 26 [d g:10, c]; 27#if __cplusplus <= 199711L // C++03 or earlier modes28 // expected-warning@-2{{cannot pass object of non-POD type 'C' through variadic method; call will abort at runtime}}29#endif30 [d g:10, version];31}32 33void t2(D *d, id p)34{35 [d g:10, p];36}37 38void t3(D *d, id<P> p)39{40 [d g:10, p];41}42