Don't allow __VA_OPT__ to be detected by #ifdef.
authorRichard Smith <richard@metafoo.co.uk>
Wed, 27 Jan 2021 21:14:02 +0000 (13:14 -0800)
committerRichard Smith <richard@metafoo.co.uk>
Wed, 27 Jan 2021 21:34:15 +0000 (13:34 -0800)
commit5dfa37a76153f2a18ac7fe30721cc1332b672ea2
tree91c94482bc0541344649fe7ddf33a976877af197
parent44f792966e0f2935ea9e0ce96a4f35e01bfe6b61
Don't allow __VA_OPT__ to be detected by #ifdef.

More study has discovered this to not actually be useful: because
current C++20 implementations reject `#ifdef __VA_OPT__`, this can't
really be used as a feature-test mechanism. And it's not too hard to
detect __VA_OPT__ without this, for example:

  #define THIRD_ARG(a, b, c, ...) c
  #define HAS_VA_OPT(...) THIRD_ARG(__VA_OPT__(,), 1, 0, )
  #if HAS_VA_OPT(?)

Partially reverts 0436ec2128c9775ba13b0308937238fc79673fdd.
clang/include/clang/Lex/Preprocessor.h
clang/lib/Lex/PPDirectives.cpp
clang/lib/Lex/PPExpressions.cpp
clang/lib/Lex/PPMacroExpansion.cpp
clang/lib/Lex/Preprocessor.cpp
clang/test/Preprocessor/macro_vaopt_check.cpp