googletest
googletest copied to clipboard
fix: Take the C++ standard version into account when using `__has_cpp_attribute`
trafficstars
Resolves #4605
As elaborated in the issue, GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(maybe_unused) failing to consider the C++ standard can cause -Wc++17-attribute-extensions warning in C++14.
This PR applies the patch equivalent to what the issue proposed, but uses GTEST_INTERNAL_CPLUSPLUS_LANG instead of __cplusplus.
I ran into this issue and verified this fix on Ubuntu 24.04 using googletest v1.16.0 and clang 19.1.7