Commit bf93dba8 by Derek Mauro Committed by Copybara-Service

counting_allocator: suppress bogus -Wuse-after-free warning in GCC 12

PiperOrigin-RevId: 454932630
Change-Id: Ifc716552bb0cd7babcaf416fe28462c15b4c7f23
parent 76c7ad82
...@@ -80,7 +80,15 @@ class CountingAllocator { ...@@ -80,7 +80,15 @@ class CountingAllocator {
template <typename U> template <typename U>
void destroy(U* p) { void destroy(U* p) {
Allocator allocator; Allocator allocator;
// Ignore GCC warning bug.
#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuse-after-free"
#endif
AllocatorTraits::destroy(allocator, p); AllocatorTraits::destroy(allocator, p);
#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
#pragma GCC diagnostic pop
#endif
if (instance_count_ != nullptr) { if (instance_count_ != nullptr) {
*instance_count_ -= 1; *instance_count_ -= 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment