llvm-project/clang/test/SemaObjCXX/property-placement-new.mm
Sirraide af0ee617fc
[Clang] Support MSPropertyRefExpr as placement arg to new-expression (#75883)
It seems we were forgetting to call `checkArgsForPlaceholders` on the
placement arguments of new-expressions in Sema. I don't think that was
intended—at least doing so doesn't seem to break anything—so this pr
adds that.

This also fixes #65053

---------

Co-authored-by: Erich Keane <ekeane@nvidia.com>
2024-01-17 15:09:31 -08:00

29 lines
465 B
Plaintext

// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wno-objc-root-class %s
// expected-no-diagnostics
@interface I {
int position;
}
@property(nonatomic) int position;
@end
struct S {
void *operator new(__SIZE_TYPE__, int);
};
template <typename T>
struct TS {
void *operator new(__SIZE_TYPE__, T);
};
I *GetI();
int main() {
@autoreleasepool {
auto* i = GetI();
i.position = 42;
new (i.position) S;
new (i.position) TS<double>;
}
}