Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yuyawk
Copy link

@yuyawk yuyawk commented Feb 7, 2025

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.

@thirtytwobits
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE is not accounting for the standard in which attribute is introduced
2 participants