summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Mauro <dmauro@google.com>2023-01-12 16:09:49 (GMT)
committerCopybara-Service <copybara-worker@google.com>2023-01-12 16:10:36 (GMT)
commitb5401fef68794d93b7fcd933bc3692211e8ebad1 (patch)
tree8a9726665b99552753b87edbaa76ee41453a7844
parenta652ae05755c5d95e9b11ef0c4bc0b715e4332d4 (diff)
downloadgoogletest-b5401fef68794d93b7fcd933bc3692211e8ebad1.zip
googletest-b5401fef68794d93b7fcd933bc3692211e8ebad1.tar.gz
googletest-b5401fef68794d93b7fcd933bc3692211e8ebad1.tar.bz2
Add an explicit #error that C++ versions less than C++14 are not supported
PiperOrigin-RevId: 501568410 Change-Id: I0f78cd96dc9204c8ec97a1cdd09a9d63a613cc5b
-rw-r--r--googletest/include/gtest/internal/gtest-port.h13
1 files changed, 13 insertions, 0 deletions
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 <ctype.h> // for isspace, etc
#include <stddef.h> // for ptrdiff_t
#include <stdio.h>