summaryrefslogtreecommitdiffstats
path: root/test/SemaObjCXX/vararg-non-pod.mm
blob: eeed09e61637b2440753c453e505360eb6b4b297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// RUN: clang-cc -fsyntax-only -verify %s

extern char version[];

@protocol P;

class C {
public:
  C(int);
};

@interface D 
- (void)g:(int)a, ...;
@end

void t1(D *d)
{
  C c(10);

  [d g:10, c]; // expected-warning{{cannot pass object of non-POD type 'class C' through variadic method; call will abort at runtime}}
  [d g:10, version];
}

void t2(D *d, id p)
{
  [d g:10, p];
}

void t3(D *d, id<P> p)
{
  [d g:10, p];
}
OpenPOWER on IntegriCloud