diff --git a/strings/base_delegate.h b/strings/base_delegate.h index e3995dd11..fa1484dd2 100644 --- a/strings/base_delegate.h +++ b/strings/base_delegate.h @@ -1,6 +1,11 @@ namespace winrt::impl { +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4458) // declaration hides class member (okay because we do not use named members of base class) +#endif + template struct implements_delegate : abi_t, H, update_module_lock { @@ -187,6 +192,10 @@ namespace winrt::impl return { static_cast(new variadic_delegate(std::forward(handler))), take_ownership_from_abi }; } }; + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif } WINRT_EXPORT namespace winrt diff --git a/test/test/pch.h b/test/test/pch.h index f027fb732..ea74230cc 100644 --- a/test/test/pch.h +++ b/test/test/pch.h @@ -1,5 +1,7 @@ #pragma once +#pragma warning(4: 4458) // ensure we compile clean with this warning enabled + #define WINRT_LEAN_AND_MEAN #include #include "winrt/Windows.Foundation.Collections.h"