From 9e408e050ff3c1db12f9a58081b6af10e05561c4 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Fri, 20 May 2022 16:10:45 -0700 Subject: 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 --- absl/strings/internal/cord_internal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'absl/strings/internal/cord_internal.h') diff --git a/absl/strings/internal/cord_internal.h b/absl/strings/internal/cord_internal.h index 6ae418e7..b50fb79a 100644 --- a/absl/strings/internal/cord_internal.h +++ b/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; } -- cgit v1.2.3