summaryrefslogtreecommitdiff
path: root/absl/base
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2022-07-06 19:08:47 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-07-06 19:09:41 -0700
commit97ab3dcfd6490434202e4ab00b2eaba9449e42a1 (patch)
tree9a4a5008b535d52ed0be0807a1262c5c7c036922 /absl/base
parent9edef2349c8c4ace11b4a1b97365cf9c9a293dc8 (diff)
Move Abseil to C++14 minimum
Adds policy checks the raise the minimum C++ version to C++14 and the minimum GCC version to GCC 5 Updates the docs to indicate the C++14 minimum. PiperOrigin-RevId: 459401288 Change-Id: I18878f0e13001c57e97e26ad7c9a9c9c12c39265
Diffstat (limited to 'absl/base')
-rw-r--r--absl/base/policy_checks.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/absl/base/policy_checks.h b/absl/base/policy_checks.h
index 06b32439..d13073c8 100644
--- a/absl/base/policy_checks.h
+++ b/absl/base/policy_checks.h
@@ -50,11 +50,11 @@
#error "This package requires Visual Studio 2015 Update 2 or higher."
#endif
-// We support gcc 4.7 and later.
+// We support gcc 5 and later.
// This minimum will go up.
#if defined(__GNUC__) && !defined(__clang__)
-#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
-#error "This package requires gcc 4.7 or higher."
+#if __GNUC__ < 5
+#error "This package requires gcc 5 or higher."
#endif
#endif
@@ -69,13 +69,15 @@
// C++ Version Check
// -----------------------------------------------------------------------------
-// Enforce C++11 as the minimum. Note that Visual Studio has not
-// advanced __cplusplus despite being good enough for our purposes, so
-// so we exempt it from the check.
-#if defined(__cplusplus) && !defined(_MSC_VER)
-#if __cplusplus < 201103L
-#error "C++ versions less than C++11 are not supported."
-#endif
+// Enforce C++14 as the minimum.
+#if defined(_MSVC_LANG)
+#if _MSVC_LANG < 201402L
+#error "C++ versions less than C++14 are not supported."
+#endif // _MSVC_LANG < 201402L
+#elif defined(__cplusplus)
+#if __cplusplus < 201402L
+#error "C++ versions less than C++14 are not supported."
+#endif // __cplusplus < 201402L
#endif
// -----------------------------------------------------------------------------