Open b1622bb8-0285-400e-ba44-ba0e5027e546 opened 8 years ago
If the -Wno-invalid-token-paste
option is passed to clang-cl when compiling, the code compiles without errors. The -Wno-invalid-token-paste
should be the default when targeting VC++ since the VC++ preprocessor works as if -Wno-invalid-token-paste
were in effect and clang targeting VC++ is emulating the VC++ preprocessor with its non-standard behavior.
Related: An alternative to making the MSVC preprocessor emulation more like MSVC is to give MSVC ABI target users the ability to choose an ISO standard preprocessor instead whilst retaining the MSVC ABI target: https://llvm.org/bugs/show_bug.cgi?id=27169
Extended Description
The following code compiles without error using VC++ 14 but gives errors using the latest clang-cl from the 'trunk':
The clang errors are:
The clang-cl options are:
The VC++14 options when compiling successfully are:
This example is a simplified version of a failure which occurs when running the Boost Preprocessor library tests with clang-cl, where the Boost Preprocessor library is setup to use the exact same workarounds for clang-cl as it does for VC++, since neither is a C++ standard conforming preprocessor.
A possible fix for this problem is not a change in the code above, even if some specific change in the code will get clang-cl to work. If clang-cl is truly emulating the non-standard VC++ preprocessor it must be able to compile preprocessor code which VC++ also compiles without errors. Thus I am reporting this problem here.