annotate clang/test/SemaObjCXX/vararg-non-pod.mm @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs -std=c++98
anatofuz
parents:
diff changeset
3 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-error=non-pod-varargs -std=c++11
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 #if __cplusplus > 199711L
anatofuz
parents:
diff changeset
6 // expected-no-diagnostics
anatofuz
parents:
diff changeset
7 #endif
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 extern char version[];
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 @protocol P;
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 class C {
anatofuz
parents:
diff changeset
14 public:
anatofuz
parents:
diff changeset
15 C(int);
anatofuz
parents:
diff changeset
16 };
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 @interface D
anatofuz
parents:
diff changeset
19 - (void)g:(int)a, ...;
anatofuz
parents:
diff changeset
20 @end
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 void t1(D *d)
anatofuz
parents:
diff changeset
23 {
anatofuz
parents:
diff changeset
24 C c(10);
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 [d g:10, c];
anatofuz
parents:
diff changeset
27 #if __cplusplus <= 199711L // C++03 or earlier modes
anatofuz
parents:
diff changeset
28 // expected-warning@-2{{cannot pass object of non-POD type 'C' through variadic method; call will abort at runtime}}
anatofuz
parents:
diff changeset
29 #endif
anatofuz
parents:
diff changeset
30 [d g:10, version];
anatofuz
parents:
diff changeset
31 }
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 void t2(D *d, id p)
anatofuz
parents:
diff changeset
34 {
anatofuz
parents:
diff changeset
35 [d g:10, p];
anatofuz
parents:
diff changeset
36 }
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 void t3(D *d, id<P> p)
anatofuz
parents:
diff changeset
39 {
anatofuz
parents:
diff changeset
40 [d g:10, p];
anatofuz
parents:
diff changeset
41 }