summaryrefslogtreecommitdiff
path: root/absl/base/config.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-08-05 06:56:05 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-08-05 06:56:59 -0700
commitcfe27e79cfcbefb2b4479e04f80cbb299bc46965 (patch)
tree7294acf94b9892a35927c5967c950192ed2acc2c /absl/base/config.h
parentc9736080610480eac20c946f0369ff0d05679842 (diff)
Map the absl::is_trivially_* functions to their std impl
There's no point redefining these functions if they are supported by the compiler and the version of libstdc++. Also, some of the builtins used by the absl implementation of these functions (e.g. __has_trivial_destructor) have been deprecated in Clang 15. PiperOrigin-RevId: 465554125 Change-Id: I8674c3a5270ce3c654cdf58ae7dbd9d2bda8faa5
Diffstat (limited to 'absl/base/config.h')
-rw-r--r--absl/base/config.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/absl/base/config.h b/absl/base/config.h
index 94f7fcb5..2faed85a 100644
--- a/absl/base/config.h
+++ b/absl/base/config.h
@@ -273,6 +273,17 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#define ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE 1
#endif
+// ABSL_HAVE_STD_IS_TRIVIALLY_COPYABLE
+//
+// Checks whether `std::is_trivially_copyable<T>` is supported.
+//
+// Notes: Clang 15+ with libc++ supports these features, GCC hasn't been tested.
+#if defined(ABSL_HAVE_STD_IS_TRIVIALLY_COPYABLE)
+#error ABSL_HAVE_STD_IS_TRIVIALLY_COPYABLE cannot be directly set
+#elif defined(__clang__) && (__clang_major__ >= 15)
+#define ABSL_HAVE_STD_IS_TRIVIALLY_COPYABLE 1
+#endif
+
// ABSL_HAVE_THREAD_LOCAL
//
// Checks whether C++11's `thread_local` storage duration specifier is