Cord: workaround a GCC 12.1 bug that triggers a spurious warning

See the GCC bug report
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105585

and Abseil bug report
https://github.com/abseil/abseil-cpp/issues/1175

Fixes #1175

PiperOrigin-RevId: 450083136
Change-Id: I207aaffaec9166b335065dd6ef148a721b94048e
pull/1186/head
Derek Mauro 3 years ago committed by Copybara-Service
parent b8bbe92f84
commit 9e408e050f
  1. 4
      absl/strings/internal/cord_internal.h

@ -632,7 +632,9 @@ inline const CordRepExternal* CordRep::external() const {
}
inline CordRep* CordRep::Ref(CordRep* rep) {
assert(rep != nullptr);
// ABSL_ASSUME is a workaround for
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105585
ABSL_ASSUME(rep != nullptr);
rep->refcount.Increment();
return rep;
}

Loading…
Cancel
Save