Commit cb808e2
committed
Fix detection of TROMPELOEIL_HAS_VA_OPT for MSVC
Only the new conformant MSVC preprocessor (_MSVC_TRADITIONAL==0) ever has
__VA_OPT__. This became avaialble with Visual Studio 16.6, but only if
running in /std:c++20 or /std:c++latest mode (i.e. _MSVC_LANG > c++17).
- https://devblogs.microsoft.com/cppblog/announcing-full-support-for-a-c-c-conformant-preprocessor-in-msvc/
Starting with Visual Studio 17.10, it is now enabled regardless of /std
This was changed to better match the behavaior of GCC and clang,
which also loosened up their checks:
- https://developercommunity.visualstudio.com/t/Zc:preprocessor-__VA_OPT__-is-not-enabl/10205604
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98859
(GCC 13 and up allow __VA_OPT__ in -std=c2x as well as -std=c++20)
- https://reviews.llvm.org/D91913
(clang 12 and up allow __VA_OPT__ regardless of c/c++ standard)
The MSVC traditional preprocessor (_MSVC_TRADITIONAL defined and nonzero)
never supports __VA_OPT__, regardless of MSVC or c++ standard version.1 parent dcb489c commit cb808e2
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 | | |
131 | | - | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| |||
0 commit comments