googletest icon indicating copy to clipboard operation
googletest copied to clipboard

fix: Take the C++ standard version into account when using `__has_cpp_attribute`

Open yuyawk opened this issue 9 months ago • 1 comments
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.

yuyawk avatar Feb 07 '25 17:02 yuyawk

I ran into this issue and verified this fix on Ubuntu 24.04 using googletest v1.16.0 and clang 19.1.7

thirtytwobits avatar Feb 26 '25 23:02 thirtytwobits