https://bugs.llvm.org/show_bug.cgi?id=51610
Bug ID: 51610
Summary: In certain cases `__VA_OPT__` incorectly expands to
nothing when `-fms-compatibility` is present
Product: clang
Version: 12.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: blck...@inbox.ru
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk
Clang with no flags successfully compiles following code:
#define CHECK_COMMA(...) CHECK_COMMA_(__VA_ARGS__,)
#define CHECK_COMMA_(x, ...) (__VA_OPT__(1) + 0)
static_assert(!CHECK_COMMA());
static_assert(CHECK_COMMA(,));
But if you add `-fms-compatibility`, the second assert fails.
This doesn't match the behavior of MSVC. MSVC v19.29 (VS16.11) with `/std:c++20
/Zc:preprocessor` compiles it successfully, and if you disable the
standard-conformant preprocessor the first assertion fails.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs