bx icon indicating copy to clipboard operation
bx copied to clipboard

Compatible with clang-cl

Open actboy168 opened this issue 1 year ago • 5 comments

actboy168 avatar Feb 02 '24 14:02 actboy168

#include <print>

int main() {
    std::println("__cplusplus={}", __cplusplus);
    std::println("_MSVC_LANG={}", _MSVC_LANG);
    return 0;
}

When compiled with /std:c++latest, clang-cl outputs:

__cplusplus=202400
_MSVC_LANG=202004

actboy168 avatar Feb 02 '24 15:02 actboy168

And when you add /Zc:__cplusplus option?

bkaradzic avatar Feb 02 '24 16:02 bkaradzic

And when you add /Zc:__cplusplus option?

Yes. Actually in clang-cl, __cplusplus always has the correct value. Even without /Zc:__cplusplus.

actboy168 avatar Feb 02 '24 16:02 actboy168

Yes.

Yes what?

Does _MSVC_LANG match __cplusplus once you set /Zc:__cplusplus?

bkaradzic avatar Feb 02 '24 16:02 bkaradzic

I have added /Zc:__cplusplus.

actboy168 avatar Feb 02 '24 16:02 actboy168