]> git-server-git.apps.pok.os.sepia.ceph.com Git - googletest.git/commitdiff
Add an explicit #error that C++ versions less than C++14 are not supported
authorDerek Mauro <dmauro@google.com>
Thu, 12 Jan 2023 16:09:49 +0000 (08:09 -0800)
committerCopybara-Service <copybara-worker@google.com>
Thu, 12 Jan 2023 16:10:36 +0000 (08:10 -0800)
PiperOrigin-RevId: 501568410
Change-Id: I0f78cd96dc9204c8ec97a1cdd09a9d63a613cc5b

googletest/include/gtest/internal/gtest-port.h

index 5d81adb3520fba2b285f66da7c2cc02bb304fd8e..6db191b7a069821eaf641c6e082993b44905684a 100644 (file)
 //                                        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>