summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
authorGravatar Dino Radakovic <dinor@google.com>2022-06-16 14:09:05 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-06-16 14:09:51 -0700
commitc3c49150cc9711371c4402ceaa6143e4cc91d9a8 (patch)
tree9908ab320f3350105a8f9157d828f0dcff47a542 /absl
parent44050f0d60e8196773f9af693932b668d1877c1b (diff)
absl/base/internal/invoke: Ignore bogus warnings on GCC >= 11
PiperOrigin-RevId: 455463553 Change-Id: Ifa6c238556339dd4e36715ac040ca048f2f84a9a
Diffstat (limited to 'absl')
-rw-r--r--absl/base/internal/invoke.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/absl/base/internal/invoke.h b/absl/base/internal/invoke.h
index 018b1af3..643c2a42 100644
--- a/absl/base/internal/invoke.h
+++ b/absl/base/internal/invoke.h
@@ -102,8 +102,18 @@ struct MemFunAndRef : StrippedAccept<MemFunAndRef> {
static decltype((std::declval<Obj>().*
std::declval<MemFun>())(std::declval<Args>()...))
Invoke(MemFun&& mem_fun, Obj&& obj, Args&&... args) {
+// Ignore bogus GCC warnings on this line.
+// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101436 for similar example.
+#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(11, 0)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
return (std::forward<Obj>(obj).*
std::forward<MemFun>(mem_fun))(std::forward<Args>(args)...);
+#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(11, 0)
+#pragma GCC diagnostic pop
+#endif
}
};