From b5401fef68794d93b7fcd933bc3692211e8ebad1 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Thu, 12 Jan 2023 08:09:49 -0800 Subject: Add an explicit #error that C++ versions less than C++14 are not supported PiperOrigin-RevId: 501568410 Change-Id: I0f78cd96dc9204c8ec97a1cdd09a9d63a613cc5b --- googletest/include/gtest/internal/gtest-port.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index 5d81adb..6db191b 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -257,6 +257,19 @@ // deprecated; calling a marked function // should generate a compiler warning +// The definition of GTEST_INTERNAL_CPLUSPLUS_LANG comes first because it can +// potentially be used as an #include guard. +#if defined(_MSVC_LANG) +#define GTEST_INTERNAL_CPLUSPLUS_LANG _MSVC_LANG +#elif defined(__cplusplus) +#define GTEST_INTERNAL_CPLUSPLUS_LANG __cplusplus +#endif + +#if !defined(GTEST_INTERNAL_CPLUSPLUS_LANG) || \ + GTEST_INTERNAL_CPLUSPLUS_LANG < 201402L +#error C++ versions less than C++14 are not supported. +#endif + #include // for isspace, etc #include // for ptrdiff_t #include -- cgit v0.12