@@ -1130,15 +1130,15 @@ namespace cppwinrt
11301130 {
11311131 // we intentionally ignore errors when unregistering event handlers to be consistent with event_revoker
11321132 //
1133- // The `noexcept` versions will crash if check_cast_result throws but that is no different than previous
1133+ // The `noexcept` versions will crash if check_hresult throws but that is no different than previous
11341134 // behavior where it would not check the cast result and nullptr crash. At least the exception will terminate
11351135 // immediately while preserving the error code and local variables.
11361136 format = R"( template <typename D%> auto consume_%<D%>::%(%) const noexcept
11371137 {%
11381138 if constexpr (!std::is_same_v<D, %>)
11391139 {
11401140 auto const [castedResult, code] = static_cast<D const*>(this)->template try_as_with_reason<%>();
1141- check_cast_result (code);
1141+ check_hresult (code);
11421142 auto const abiType = *(abi_t<%>**)&castedResult;
11431143 abiType->%(%);
11441144 }
@@ -1157,7 +1157,7 @@ namespace cppwinrt
11571157 if constexpr (!std::is_same_v<D, %>)
11581158 {
11591159 auto const [castedResult, code] = static_cast<D const*>(this)->template try_as_with_reason<%>();
1160- check_cast_result (code);
1160+ check_hresult (code);
11611161 auto const abiType = *(abi_t<%>**)&castedResult;
11621162 WINRT_VERIFY_(0, abiType->%(%));
11631163 }
@@ -1177,7 +1177,7 @@ namespace cppwinrt
11771177 if constexpr (!std::is_same_v<D, %>)
11781178 {
11791179 auto const [castedResult, code] = static_cast<D const*>(this)->template try_as_with_reason<%>();
1180- check_cast_result (code);
1180+ check_hresult (code);
11811181 auto const abiType = *(abi_t<%>**)&castedResult;
11821182 check_hresult(abiType->%(%));
11831183 }
0 commit comments