From 97ab3dcfd6490434202e4ab00b2eaba9449e42a1 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Wed, 6 Jul 2022 19:08:47 -0700 Subject: 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 --- absl/base/policy_checks.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'absl/base/policy_checks.h') 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 // ----------------------------------------------------------------------------- -- cgit v1.2.3