summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2022-05-20 16:10:45 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-05-20 16:11:36 -0700
commit9e408e050ff3c1db12f9a58081b6af10e05561c4 (patch)
tree9327b889d3a0934c66e78b4be30e4ff695d818af /absl
parentb8bbe92f84ffe1e249016cfe8b79efdffb7a35c1 (diff)
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
Diffstat (limited to 'absl')
-rw-r--r--absl/strings/internal/cord_internal.h4
1 files changed, 3 insertions, 1 deletions
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;
}