3 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm
6 // RUN: %clang_cc1 -std=c++20 %t/Use.cpp -fprebuilt-module-path=%t -fsyntax-only -verify
10 using size_t = decltype(sizeof(0));
12 void *operator new(std::size_t, void *p
) { return p
; }
16 #include "placement.h"
18 export
template<class T
>
20 A(void *p
) : ptr(new (p
) T(43)) {}
26 B(void *p
) : ptr(new (p
) int(43)) {}
32 // expected-no-diagnostics
36 A
<int>(nullptr); // Good. It should be OK to construct A.
37 void *p
= ::operator new(sizeof(int), ptr
); // Bad. The function shouldn't be visible here.
38 void *q
= new (ptr
) int(43); // Good. We don't call the placement allocation function directly.