chakra-core / ChakraCore

ChakraCore is an open source Javascript engine with a C API.
MIT License
9.13k stars 1.2k forks source link

Msvc with ‘/std:c++latest’: std::uncaught_exception() is deprecated in C++17 #3147

Open PhoebeHui opened 7 years ago

PhoebeHui commented 7 years ago

std::uncaught_exception() is deprecated in C++17, which is breaking builds by msvc with ‘/std:c++latest’ option on Windows. Even I /D _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING to avoid the warning, but Chakra need address the issue since it affects all users.

https://github.com/Microsoft/ChakraCore/blob/master/bin/External/catch.hpp#L7915

D:\Chakra\src\bin\External\catch.hpp(7915): error C2220: warning treated as error - no 'object' file generated (compiling source file NativeTests.cpp) D:\Chakra\src\bin\External\catch.hpp(7915): warning C4996: 'std::uncaught_exception': warning STL4006: std::uncaught_exception() is deprecated in C++17. It is superseded by std::uncaught_exceptions(), plural. You can define _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file NativeTests.cpp)

StephanTLavavej commented 7 years ago

Please note that Phoebe is referring to a C++17 deprecation warning that I've implemented in an unreleased build of MSVC 2017 (the second toolset update; not 2017 15.3 which is the first toolset update).

curtisman commented 7 years ago

Catch is an external dependency we use for our native unit test. As such, we probably won't fix unless the external dependency make the change as well.

StephanTLavavej commented 7 years ago

The warning has been suppressed in upstream Catch: https://github.com/philsquared/Catch/issues/927