Possible __VA_OPT__ bug

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

 



Given:

#define NO_DATA
#define TRY_VA_OPT(...)  __VA_OPT__ (0) 1

TRY_VA_OPT() -> expands to 1 as expected
TRY_VA_OPT(NO_DATA) -> expands to 0 1 which is not expected

when compiled with gcc-9.2 with -std=c++2a.

I have not tested with gcc-8.1 on up at all C++ standard levels, as __VA_OPT__ is supported there also, but I expect the same results will occur.

I see no reason why both do not expand to 1. Is this a gcc bug ? If so, I will report it to gcc. If not can anyone explain the second output ?

The command line parameters i used are:

-fvisibility-inlines-hidden -fPIC -m64 -pthread -O0 -fno-inline -Wall -Wextra -pedantic -g -fvisibility=hidden -Wno-variadic-macros -ftrack-macro-expansion=0 -std=c++2a





[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