diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 2957221d466617..3c15b9ff389f27 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -5,7 +5,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/configuretools.cmake) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # We need to set this to Release as there's no way to intercept configuration-specific linker flags diff --git a/src/coreclr/ilasm/assem.cpp b/src/coreclr/ilasm/assem.cpp index 8daec130bcc76a..912ab2f3c9b2b3 100644 --- a/src/coreclr/ilasm/assem.cpp +++ b/src/coreclr/ilasm/assem.cpp @@ -1521,7 +1521,7 @@ unsigned hash( unsigned length, /* the length of the key */ unsigned initval) /* the previous hash, or an arbitrary value */ { - register unsigned a,b,c,len; + unsigned a,b,c,len; /* Set up the internal state */ len = length; diff --git a/src/coreclr/nativeaot/Bootstrap/stdcppshim.cpp b/src/coreclr/nativeaot/Bootstrap/stdcppshim.cpp index e8f9a07afbb775..25d31f68986577 100644 --- a/src/coreclr/nativeaot/Bootstrap/stdcppshim.cpp +++ b/src/coreclr/nativeaot/Bootstrap/stdcppshim.cpp @@ -7,6 +7,7 @@ namespace std { struct nothrow_t {}; extern const nothrow_t nothrow = {}; + using size_t = ::size_t; } void* operator new(size_t n, const std::nothrow_t&) noexcept @@ -28,3 +29,13 @@ void operator delete[](void *p) noexcept { free(p); } + +void operator delete(void* p, std::size_t) noexcept +{ + free(p); +} + +void operator delete[](void* p, std::size_t) noexcept +{ + free(p); +} diff --git a/src/coreclr/pal/src/include/pal/list.h b/src/coreclr/pal/src/include/pal/list.h index 8f4d734ba3fcee..78c840969021cf 100644 --- a/src/coreclr/pal/src/include/pal/list.h +++ b/src/coreclr/pal/src/include/pal/list.h @@ -22,12 +22,13 @@ Revision History: #ifndef _LIST_H_INCLUDED #define _LIST_H_INCLUDED +#include + #ifdef __cplusplus extern "C" { #endif // __cplusplus -#include typedef struct _LIST_ENTRY { struct _LIST_ENTRY *Flink; diff --git a/src/coreclr/vm/threads.h b/src/coreclr/vm/threads.h index 3dd41dfd5f8b54..d50b680f4862e4 100644 --- a/src/coreclr/vm/threads.h +++ b/src/coreclr/vm/threads.h @@ -5156,17 +5156,24 @@ class CoopTransitionHolder { Frame * m_pFrame; +#ifdef DEBUG + int m_uncaughtExceptions; +#endif + public: CoopTransitionHolder(Thread * pThread) : m_pFrame(pThread->m_pFrame) { LIMITED_METHOD_CONTRACT; +#ifdef DEBUG + m_uncaughtExceptions = std::uncaught_exceptions(); +#endif } ~CoopTransitionHolder() { WRAPPER_NO_CONTRACT; - _ASSERTE_MSG(m_pFrame == nullptr || std::uncaught_exception(), "Early return from JIT/EE interface method"); + _ASSERTE_MSG(m_pFrame == nullptr || m_uncaughtExceptions < std::uncaught_exceptions(), "Early return from JIT/EE interface method"); if (m_pFrame != nullptr) COMPlusCooperativeTransitionHandler(m_pFrame); } diff --git a/src/native/corehost/CMakeLists.txt b/src/native/corehost/CMakeLists.txt index 5ce72395e49f7f..02ed291648817b 100644 --- a/src/native/corehost/CMakeLists.txt +++ b/src/native/corehost/CMakeLists.txt @@ -83,6 +83,8 @@ add_library(fxr_resolver INTERFACE) target_sources(fxr_resolver INTERFACE fxr_resolver.cpp) target_include_directories(fxr_resolver INTERFACE fxr) +add_compile_definitions(RAPIDJSON_HAS_CXX17) + if ((NOT DEFINED CLR_CMAKE_USE_SYSTEM_RAPIDJSON) OR (NOT CLR_CMAKE_USE_SYSTEM_RAPIDJSON)) include_directories(${CLR_SRC_NATIVE_DIR}/external/) endif() diff --git a/src/native/corehost/apphost/static/CMakeLists.txt b/src/native/corehost/apphost/static/CMakeLists.txt index 7d7d975d4bd58d..c37e523cf148bd 100644 --- a/src/native/corehost/apphost/static/CMakeLists.txt +++ b/src/native/corehost/apphost/static/CMakeLists.txt @@ -17,6 +17,8 @@ add_subdirectory(../../hostmisc hostmisc) configure_file(${CLR_SRC_NATIVE_DIR}/corehost/configure.h.in ${GENERATED_INCLUDE_DIR}/corehost/configure.h) target_include_directories(hostmisc_interface INTERFACE ${GENERATED_INCLUDE_DIR}/corehost) +add_compile_definitions(RAPIDJSON_HAS_CXX17) + if ((NOT DEFINED CLR_CMAKE_USE_SYSTEM_RAPIDJSON) OR (NOT CLR_CMAKE_USE_SYSTEM_RAPIDJSON)) include_directories(${CLR_SRC_NATIVE_DIR}/external/) endif()