std::pmr::monotonic_buffer_resource mbr(&cr);
try
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Walloc-size-larger-than="
// Try to allocate a ridiculous size:
void* p = mbr.allocate(std::size_t(-2), 1);
+#pragma GCC diagnostic pop
// Should not reach here!
VERIFY( !"attempt to allocate SIZE_MAX-1 should not have succeeded" );
throw p;
std::pmr::unsynchronized_pool_resource upr(&cr);
try
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Walloc-size-larger-than="
// Try to allocate a ridiculous size (and use a large extended alignment
// so that careful_resource::do_allocate can distinguish this allocation
// from any required for the pool resource's internal data structures):
void* p = upr.allocate(std::size_t(-2), 1024);
+#pragma GCC distinguish pop
// Should not reach here!
VERIFY( !"attempt to allocate SIZE_MAX-1 should not have succeeded" );
throw p;