Version
C++/WinRT v2.0.220418.1
Summary
In winrt::hresult_error::originate, running in the context of a Microsoft::VisualStudio::CppUnitTestFramework project, where the error info object is provided by clr.dll and it does not implement IRestrictedErrorInfo. the WINRT_VERIFY(info.try_as(m_info)) line fails the assert.
base.h, ~4892
com_ptr<impl::IErrorInfo> info;
WINRT_VERIFY_(0, WINRT_IMPL_GetErrorInfo(0, info.put_void()));
WINRT_VERIFY(info.try_as(m_info));
Is this a bug in the CLR or is the design intended to support this?
Reproducible example
TEST_METHOD(CatchCppWinRtException)
{
try
{
winrt::check_hresult(E_NOT_SET);
}
catch (...)
{
}
}
Expected behavior
no assert, but I'm not sure if this is bug in the CLR or cppwinrt
Actual behavior
assert, in debug build
Additional comments
No response
Version
C++/WinRT v2.0.220418.1
Summary
In
winrt::hresult_error::originate, running in the context of aMicrosoft::VisualStudio::CppUnitTestFrameworkproject, where the error info object is provided by clr.dll and it does not implementIRestrictedErrorInfo. theWINRT_VERIFY(info.try_as(m_info))line fails the assert.base.h, ~4892
com_ptr<impl::IErrorInfo> info; WINRT_VERIFY_(0, WINRT_IMPL_GetErrorInfo(0, info.put_void())); WINRT_VERIFY(info.try_as(m_info));Is this a bug in the CLR or is the design intended to support this?
Reproducible example
Expected behavior
no assert, but I'm not sure if this is bug in the CLR or cppwinrt
Actual behavior
assert, in debug build
Additional comments
No response