Skip to content

Commit 43ff224

Browse files
committed
fix: Take C++ version into account when checking __has_cpp_attribute
1 parent a866428 commit 43ff224

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
757757
#if defined(__has_cpp_attribute)
758758
// NOTE: requiring __cplusplus above should not be necessary, but
759759
// works around https://bugs.llvm.org/show_bug.cgi?id=23435.
760-
#define GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
760+
#define GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(x) GTEST_INTERNAL_CPLUSPLUS_LANG >= __has_cpp_attribute(x)
761761
#else
762762
#define GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(x) 0
763763
#endif

0 commit comments

Comments
 (0)