• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs
2// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs -std=c++98
3// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs -std=c++11
4
5extern char version[];
6
7@protocol P;
8
9class C {
10public:
11  C(int);
12};
13
14@interface D
15- (void)g:(int)a, ...;
16@end
17
18void t1(D *d)
19{
20  C c(10);
21
22  [d g:10, c];
23#if __cplusplus <= 199711L // C++03 or earlier modes
24  // expected-warning@-2{{cannot pass object of non-POD type 'C' through variadic method; call will abort at runtime}}
25#else
26  // expected-no-diagnostics@-4
27#endif
28  [d g:10, version];
29}
30
31void t2(D *d, id p)
32{
33  [d g:10, p];
34}
35
36void t3(D *d, id<P> p)
37{
38  [d g:10, p];
39}
40