xref: /llvm-project/clang/test/SemaObjCXX/property-placement-new.mm (revision af0ee617fc5f69051297b0c23f8c818b20f02c3a)
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
10struct S {
11  void *operator new(__SIZE_TYPE__, int);
12};
13
14template <typename T>
15struct TS {
16  void *operator new(__SIZE_TYPE__, T);
17};
18
19I *GetI();
20
21int main() {
22  @autoreleasepool {
23    auto* i = GetI();
24    i.position = 42;
25    new (i.position) S;
26    new (i.position) TS<double>;
27  }
28}
29