diff --git a/cmake/DaemonFlags.cmake b/cmake/DaemonFlags.cmake index 27e9513a15..cdd1fea713 100644 --- a/cmake/DaemonFlags.cmake +++ b/cmake/DaemonFlags.cmake @@ -134,6 +134,9 @@ if (MSVC) set_c_cxx_flag("/fp:fast") set_c_cxx_flag("/d2Zi+" RELWITHDEBINFO) + # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ + set_cxx_flag("/Zc:__cplusplus") + # At least Ninja doesn't remove the /W3 flag when we add /W4|/Wall one, which # leads to compilation warnings. Remove /W3 entirely, as /W4|/Wall be used. foreach(flag_var diff --git a/src/common/Compiler.h b/src/common/Compiler.h index 9541af84a5..4e54ceea42 100644 --- a/src/common/Compiler.h +++ b/src/common/Compiler.h @@ -247,6 +247,8 @@ See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0627r0.pdf */ // assignments so that containers move objects instead of copying them. #if __cplusplus >= 201103 #define NOEXCEPT noexcept +#elif _MSC_VER + #define NOEXCEPT noexcept #else #define NOEXCEPT #endif