[PATCH] D78186: [flang] Don't check __cplusplus value with MSVC.

مهدي شينون (Mehdi Chinoune) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 05:20:59 PDT 2020


ChinouneMehdi added a comment.

In D78186#2020040 <https://reviews.llvm.org/D78186#2020040>, @aaron.ballman wrote:

> In D78186#2019997 <https://reviews.llvm.org/D78186#2019997>, @ChinouneMehdi wrote:
>
> > In D78186#2019986 <https://reviews.llvm.org/D78186#2019986>, @aaron.ballman wrote:
> >
> > > I don't think this preserves the intended behavior of the original code -- now MSVC will never check for C++17 mode. I believe the correct way to fix this is to set `/Zc:__cplusplus` when compiling with MSVC, unless there's a reason that's not possible?
> >
> >
> > Well, C++17 mode is already checked with CMake, so there is no need to check it with the compiler. I excluded MSVC just because @sscalpone insisted to preserve the original code.
>
>
> There's a small chance someone could skip CMake entirely and use these files directly (that happens with LLVM support code from time to time, for instance), so I think preserving the behavior of the original code is a reasonable idea. If we set up the CMake to tell MSVC to use the right value for `__cplusplus`, then the code in `idioms.h` requires no changes and will do the right thing.


`/Zc:__cplusplus` is only available with Visual Studio >= 15.7. the code requires a change in a way or another.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78186/new/

https://reviews.llvm.org/D78186





More information about the llvm-commits mailing list