You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error message is hard to understand.
It seems like type-cast related. main.cpp:284:1: error: ‘static void promise_type_base<T, G, InitialSuspend>::operator delete(void*, size_t) [with T = std::__cxx11::basic_string<char>; G = generator<std::__cxx11::basic_string<char>, false>; bool InitialSuspend = false]’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete] 284 | } | ^ 02.25-coroutineParsingDataStreamCustomAllocator1/main.cpp:284:1: note: returned from ‘static void* promise_type_base<T, G, InitialSuspend>::operator new(size_t, arena&, TheRest&& ...) [with TheRest = {DataStreamReader&}; T = std::__cxx11::basic_string<char>; G = generator<std::__cxx11::basic_string<char>, false>; bool InitialSuspend = false]’ /home/wps/cpp20/coro-study/02.25-coroutineParsingDataStreamCustomAllocator1/main.cpp: In function ‘generator<std::byte> sender(arena&, std::vector<std::byte>)’: 02.25-coroutineParsingDataStreamCustomAllocator1/main.cpp:292:1: error: ‘static void promise_type_base<T, G, InitialSuspend>::operator delete(void*, size_t) [with T = std::byte; G = generator<std::byte>; bool InitialSuspend = true]’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete] 292 | } | ^ 02.25-coroutineParsingDataStreamCustomAllocator1/main.cpp:292:1: note: returned from ‘static void* promise_type_base<T, G, InitialSuspend>::operator new(size_t, arena&, TheRest&& ...) [with TheRest = {std::vector<std::byte, std::allocator<std::byte> >&}; T = std::byte; G = generator<std::byte>; bool InitialSuspend = true]’ cc1plus: all warnings being treated as errors
The text was updated successfully, but these errors were encountered:
as far as I can see, this is the result of a new warning in GCC mismatched-new-delete. I wasn't able to quickly understand what this warning is complaining about and whether this isn't a false positive.
However, you can disable this warning -Wnomismatched-new-delete to get the code working. I hope this helps.
The error message is hard to understand.
It seems like type-cast related.
main.cpp:284:1: error: ‘static void promise_type_base<T, G, InitialSuspend>::operator delete(void*, size_t) [with T = std::__cxx11::basic_string<char>; G = generator<std::__cxx11::basic_string<char>, false>; bool InitialSuspend = false]’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete] 284 | } | ^ 02.25-coroutineParsingDataStreamCustomAllocator1/main.cpp:284:1: note: returned from ‘static void* promise_type_base<T, G, InitialSuspend>::operator new(size_t, arena&, TheRest&& ...) [with TheRest = {DataStreamReader&}; T = std::__cxx11::basic_string<char>; G = generator<std::__cxx11::basic_string<char>, false>; bool InitialSuspend = false]’ /home/wps/cpp20/coro-study/02.25-coroutineParsingDataStreamCustomAllocator1/main.cpp: In function ‘generator<std::byte> sender(arena&, std::vector<std::byte>)’: 02.25-coroutineParsingDataStreamCustomAllocator1/main.cpp:292:1: error: ‘static void promise_type_base<T, G, InitialSuspend>::operator delete(void*, size_t) [with T = std::byte; G = generator<std::byte>; bool InitialSuspend = true]’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete] 292 | } | ^ 02.25-coroutineParsingDataStreamCustomAllocator1/main.cpp:292:1: note: returned from ‘static void* promise_type_base<T, G, InitialSuspend>::operator new(size_t, arena&, TheRest&& ...) [with TheRest = {std::vector<std::byte, std::allocator<std::byte> >&}; T = std::byte; G = generator<std::byte>; bool InitialSuspend = true]’ cc1plus: all warnings being treated as errors
The text was updated successfully, but these errors were encountered: