absl::Optional: suppress bogus -Wmaybe-uninitialized GCC 12 warning

PiperOrigin-RevId: 454947125
Change-Id: Idbe6c8b4953c3d6147326bebc915d24dff83e7d5
pull/1200/head
Derek Mauro 2 years ago committed by Copybara-Service
parent 10ec11de9c
commit d66e0dc6cc
  1. 8
      absl/types/internal/optional.h

@ -91,7 +91,15 @@ class optional_data_dtor_base {
void destruct() noexcept {
if (engaged_) {
// `data_` must be initialized if `engaged_` is true.
#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
data_.~T();
#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
#pragma GCC diagnostic pop
#endif
engaged_ = false;
}
}

Loading…
Cancel
Save