diff options
Diffstat (limited to 'absl/functional')
-rw-r--r-- | absl/functional/CMakeLists.txt | 2 | ||||
-rw-r--r-- | absl/functional/internal/any_invocable.h | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/absl/functional/CMakeLists.txt b/absl/functional/CMakeLists.txt index 628b2ffc..c704e049 100644 --- a/absl/functional/CMakeLists.txt +++ b/absl/functional/CMakeLists.txt @@ -39,7 +39,7 @@ absl_cc_test( "any_invocable_test.cc" "internal/any_invocable.h" COPTS - ${ABSL_DEFAULT_COPTS} + ${ABSL_TEST_COPTS} DEPS absl::any_invocable absl::base_internal diff --git a/absl/functional/internal/any_invocable.h b/absl/functional/internal/any_invocable.h index a5c22ad0..a52fa876 100644 --- a/absl/functional/internal/any_invocable.h +++ b/absl/functional/internal/any_invocable.h @@ -135,8 +135,16 @@ void InvokeR(F&& f, P&&... args) { template <class ReturnType, class F, class... P, absl::enable_if_t<!std::is_void<ReturnType>::value, int> = 0> ReturnType InvokeR(F&& f, P&&... args) { + // GCC 12 has a false-positive -Wmaybe-uninitialized warning here. +#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif return absl::base_internal::invoke(std::forward<F>(f), std::forward<P>(args)...); +#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0) +#pragma GCC diagnostic pop +#endif } // |