chakra-core / ChakraCore

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

C++20 removed std::uncaught_exception #6378

Open 215020267 opened 4 years ago

215020267 commented 4 years ago

Description: In /std:c++17 mode, this triggers a deprecation warning in recent versions of MSVC. In /std:c++latest mode, now that microsoft/STL#380 has been merged, this will trigger an error in VS 2019 16.6 Preview 2.

Reproduce steps:

  1. git clone -c core.autocrlf=true https://github.com/microsoft/ChakraCore D:\Chakra\src
  2. cd /d D:\Chakra\src
  3. set CL=/D_HAS_AUTO_PTR_ETC=1 /D_SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING /Zc:noexceptTypes- /wd5043 /wd5054
  4. msbuild /m /p:Platform=x64 /p:Configuration=Test /p:WindowsTargetPlatformVersion=10.0.17134.0 Build\Chakra.Core.sln /t:Rebuild 2>&1

ErrorMessage: F:\gitP\microsoft\ChakraCore\bin\External\catch.hpp(7915): error C2039: 'uncaught_exception': is not a member of 'std' (compiling source file NativeTests.cpp) [F:\gitP\microsoft\ChakraCore\bin\NativeTests\NativeTests.vcxproj]

rhuanjl commented 4 years ago

ChakraCore is currently a C++11 codebase - there are various other issues that you will run into attempting to build with newer standards 14/17/20 etc.

I am happy to review and merge (if appropriate) any PRs to fix such issues, so please open a PR if you'd like to.

(I have too many other changes I'm working on that I need people to review for me to be making any PRs for C++ standards related points at the moment.)