File tree 2 files changed +13
-2
lines changed
tests/std/tests/P2502R2_generator_promise
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ private:
128
128
}
129
129
130
130
static void __stdcall _Dealloc_delete(void* const _Ptr, const size_t _Size) noexcept {
131
- ::operator delete[] (_Ptr, _Size + sizeof(_Dealloc_fn));
131
+ ::operator delete(_Ptr, _Size + sizeof(_Dealloc_fn));
132
132
}
133
133
134
134
template <class _ProtoAlloc>
@@ -164,7 +164,7 @@ private:
164
164
165
165
public:
166
166
static void* operator new(const size_t _Size) { // default: new/delete
167
- void* const _Ptr = ::operator new[] (_Size + sizeof(_Dealloc_fn));
167
+ void* const _Ptr = ::operator new(_Size + sizeof(_Dealloc_fn));
168
168
const _Dealloc_fn _Dealloc = _Dealloc_delete;
169
169
_CSTD memcpy(static_cast<char*>(_Ptr) + _Size, &_Dealloc, sizeof(_Dealloc_fn));
170
170
return _Ptr;
Original file line number Diff line number Diff line change 5
5
#include < coroutine>
6
6
#include < cstddef>
7
7
#include < cstdint>
8
+ #include < cstdlib>
8
9
#include < forward_list>
9
10
#include < generator>
10
11
#include < list>
22
23
23
24
using namespace std ;
24
25
26
+ #pragma warning(disable : 28251) // Inconsistent annotation for 'new[]': this instance has no annotations.
27
+
28
+ void * operator new [](size_t ) {
29
+ abort ();
30
+ }
31
+
32
+ void operator delete[] (void *) noexcept {
33
+ abort ();
34
+ }
35
+
25
36
template <class Promise , class ... Args>
26
37
concept HasOperatorNew = requires(Args&&... args) {
27
38
{ Promise::operator new (forward<Args>(args)...) } -> same_as<void *>;
You can’t perform that action at this time.
0 commit comments