Using C++20 __VA_OPT__ in a macro gives an error
Edward Diener
eldlistmailingz@tropicsoft.com
Sun Sep 29 04:08:00 GMT 2019
On 9/26/2019 3:25 PM, Edward Diener wrote:
> I have a macro which uses the C++20 construct of __VA_OPT__. During a
> compilation with og gcc-9.2 with the '-std=c++11' option the macro is
> encountered in a header file, but it is never actually invoked in the
> code. And yet gcc-9.2 gives an error of:
>
> error: __VA_OPT__ is not available until C++2a
>
> Why would this be happening ?
>
> I realize I can surround the macro with
>
> # if defined(__cplusplus) && __cplusplus > 201703L
> #endif
>
> but my understanding is that macro code is not checked until it is
> actually invoked during the preprocessing stage.
>
>
>
I know I saw this message but since I can not reproduce the occurrence
in my code the OP should be ignored.
More information about the Gcc-help
mailing list