Skip to content

Commit

Permalink
another attempt at suppressing the new/delete error
Browse files Browse the repository at this point in the history
  • Loading branch information
dietmarkuehl committed Jan 13, 2025
1 parent e9de000 commit 9b23297
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions include/beman/lazy/detail/lazy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#include <optional>
#include <type_traits>

#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wmismatched-new-delete"
#endif

// ----------------------------------------------------------------------------

namespace beman::lazy::detail {
Expand Down Expand Up @@ -120,15 +124,7 @@ struct lazy {
return ::beman::lazy::detail::coroutine_allocate<C>(size, a...);
}
void operator delete(void* ptr, std::size_t size) {
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmismatched-new-delete"
#pragma GCC diagnostic ignored "-Werror=mismatched-new-delete"
#endif
return ::beman::lazy::detail::coroutine_deallocate<C>(ptr, size);
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
}

template <typename... A>
Expand Down

0 comments on commit 9b23297

Please sign in to comment.