diff --git a/src/native/corehost/CMakeLists.txt b/src/native/corehost/CMakeLists.txt index 6976f8c21aed2..f1cc1052ce146 100644 --- a/src/native/corehost/CMakeLists.txt +++ b/src/native/corehost/CMakeLists.txt @@ -12,6 +12,12 @@ include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) if (MSVC) # Host components don't try to handle asynchronous exceptions add_compile_options($<$:/EHsc>) + + # Explicitly re-enable warnings about declation hiding (currently disabled by configurecompiler.cmake) + add_compile_options($<$:/we4456>) # declaration of 'identifier' hides previous local declaration + add_compile_options($<$:/we4457>) # declaration of 'identifier' hides function parameter + add_compile_options($<$:/we4458>) # declaration of 'identifier' hides class member + add_compile_options($<$:/we4459>) # declaration of 'identifier' hides global declaration elseif (CMAKE_CXX_COMPILER_ID MATCHES GNU) # Prevents libc from calling pthread_cond_destroy on static objects in # dlopen()'ed library which we dlclose() in pal::unload_library. diff --git a/src/native/corehost/fxr/framework_info.cpp b/src/native/corehost/fxr/framework_info.cpp index 439cde6e3980e..b8bb45e3278b8 100644 --- a/src/native/corehost/fxr/framework_info.cpp +++ b/src/native/corehost/fxr/framework_info.cpp @@ -62,10 +62,10 @@ bool compare_by_name_and_version(const framework_info &a, const framework_info & pal::readdir_onlydirectories(fx_shared_dir, &fx_names); } - for (pal::string_t fx_name : fx_names) + for (pal::string_t fx_name_local : fx_names) { auto fx_dir = fx_shared_dir; - append_path(&fx_dir, fx_name.c_str()); + append_path(&fx_dir, fx_name_local.c_str()); if (pal::directory_exists(fx_dir)) { @@ -81,7 +81,7 @@ bool compare_by_name_and_version(const framework_info &a, const framework_info & { trace::verbose(_X("Found FX version [%s]"), ver.c_str()); - framework_info info(fx_name, fx_dir, parsed, hive_depth); + framework_info info(fx_name_local, fx_dir, parsed, hive_depth); framework_infos->push_back(info); } } diff --git a/src/native/corehost/fxr/fx_resolver.cpp b/src/native/corehost/fxr/fx_resolver.cpp index df93428b74ed6..24fdc1efe26a4 100644 --- a/src/native/corehost/fxr/fx_resolver.cpp +++ b/src/native/corehost/fxr/fx_resolver.cpp @@ -268,10 +268,7 @@ namespace if (selected_ver != fx_ver_t()) { // Compare the previous hive_dir selection with the current hive_dir to see which one is the better match - std::vector version_list; - version_list.push_back(resolved_ver); - version_list.push_back(selected_ver); - resolved_ver = resolve_framework_reference_from_version_list(version_list, fx_ref); + resolved_ver = resolve_framework_reference_from_version_list({ resolved_ver, selected_ver }, fx_ref); } if (resolved_ver != selected_ver)