Fix feature detection of __VA_OPT__ for MSVC #345
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
__cplusplus >= 202002Lis combined with/Zc:preprocessor-(and fail to preprocess correctly).See https://github.com/puetzk/trompeloeil/actions/runs/14110751749 for an example where the new CI configurations (without the corresponding fix) fail to compile, because they try to use
__VA_OPT__in a configuration where the preprocessor does not support it.With the second commit (fixing the detection macro), all of the configurations now run, three of them with different behavior:
"Windows MSVC 2019 C++20 preprocessor" should detect that it does have
__VA_OPT__(because it's >= 16.6, /Zc:preprocessoris on, and/std:c++20was set, making_MSVC_TRADITIONAL=0and_MSVC_LANG=202002L."Windows MSVC 2019 C++20 __cppstd" and "Windows MSVC 2022 C++20 __cppstd" now see that they do not have
__VA_OPT__(because it's using the old preprocessor, despite being__cplusplus >= 202002LFixes #343