Using C++20 __VA_OPT__ in a macro gives an error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux