We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
__has_cpp_attribute
1 parent a866428 commit 43ff224Copy full SHA for 43ff224
googletest/include/gtest/internal/gtest-port.h
@@ -757,7 +757,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
757
#if defined(__has_cpp_attribute)
758
// NOTE: requiring __cplusplus above should not be necessary, but
759
// works around https://bugs.llvm.org/show_bug.cgi?id=23435.
760
-#define GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
+#define GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(x) GTEST_INTERNAL_CPLUSPLUS_LANG >= __has_cpp_attribute(x)
761
#else
762
#define GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(x) 0
763
#endif
0 commit comments