-
Notifications
You must be signed in to change notification settings - Fork 50
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
Support C++20 feature testing #108
Comments
I'm not sure if this is something to be supported by Wave. There are arguments both ways. On one hand, the output Wave produces should be consumable by any other compiler. And that compiler should be able to handle the feature macros depending on its own implementations. For this it might be better to leave the feature macros that identify compiler (i.e. language) features alone and pass them through to the output untouched. On the other hand, feature macros that are explicitly defined by the standard library or the compiler could be handled by Wave as any other macro, which would require for In the end, in order to achieve accurate preprocessing, the process would have to be targetable to a particular platform and/or compiler (in the same way as necessary for code that is referring to predefined macros like |
What if there was a separate mechanism, via an API on the Context object, for adding attributes? Something similar to |
C++20 introduces a special predefined macro
__has_cpp_attribute()
along with a set of predefined language feature macros, all described here. I think that at minimum__has_cpp_attribute()
should be defined in C++20 mode, even if it always evaluates totrue
.What's less clear to me is whether, and how, the return values should be user-programmable (e.g. for emulating a specific compiler version).
The text was updated successfully, but these errors were encountered: