Debian Codegraph @

clang/test/SemaObjCXX/property-placement-new.mm

raw
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wno-objc-root-class %s
2 // expected-no-diagnostics
3
4 @interface I {
5 int position;
6 }
7 @property(nonatomic) int position;
8 @end
9
10 struct S {
11 void *operator new(__SIZE_TYPE__, int);
12 };
13
14 template <typename T>
15 struct TS {
16 void *operator new(__SIZE_TYPE__, T);
17 };
18
19 I *GetI();
20
21 int main() {
22 @autoreleasepool {
23 auto* i = GetI();
24 i.position = 42;
25 new (i.position) S;
26 new (i.position) TS<double>;
27 }
28 }