Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The new variables in winrt::impl::consume_ methods can collide with parameters to that method #1455

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions cppwinrt/code_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1137,15 +1137,15 @@ namespace cppwinrt
{%
if constexpr (!std::is_same_v<D, %>)
{
auto const [castedResult, code] = impl::try_as_with_reason<%, D const*>(static_cast<D const*>(this));
check_hresult(code);
auto const abiType = *(abi_t<%>**)&castedResult;
abiType->%(%);
auto const [_winrt_casted_result, _winrt_cast_result_code] = impl::try_as_with_reason<%, D const*>(static_cast<D const*>(this));
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<%>**)&_winrt_casted_result;
_winrt_abi_type->%(%);
}
else
{
auto const abiType = *(abi_t<%>**)this;
abiType->%(%);
auto const _winrt_abi_type = *(abi_t<%>**)this;
_winrt_abi_type->%(%);
}%
}
)";
Expand All @@ -1156,15 +1156,15 @@ namespace cppwinrt
{%
if constexpr (!std::is_same_v<D, %>)
{
auto const [castedResult, code] = impl::try_as_with_reason<%, D const*>(static_cast<D const*>(this));
check_hresult(code);
auto const abiType = *(abi_t<%>**)&castedResult;
WINRT_VERIFY_(0, abiType->%(%));
auto const [_winrt_casted_result, _winrt_cast_result_code] = impl::try_as_with_reason<%, D const*>(static_cast<D const*>(this));
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<%>**)&_winrt_casted_result;
WINRT_VERIFY_(0, _winrt_abi_type->%(%));
}
else
{
auto const abiType = *(abi_t<%>**)this;
WINRT_VERIFY_(0, abiType->%(%));
auto const _winrt_abi_type = *(abi_t<%>**)this;
WINRT_VERIFY_(0, _winrt_abi_type->%(%));
}%
}
)";
Expand All @@ -1176,15 +1176,15 @@ namespace cppwinrt
{%
if constexpr (!std::is_same_v<D, %>)
{
auto const [castedResult, code] = impl::try_as_with_reason<%, D const*>(static_cast<D const*>(this));
check_hresult(code);
auto const abiType = *(abi_t<%>**)&castedResult;
check_hresult(abiType->%(%));
auto const [_winrt_casted_result, _winrt_cast_result_code] = impl::try_as_with_reason<%, D const*>(static_cast<D const*>(this));
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type = *(abi_t<%>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->%(%));
}
else
{
auto const abiType = *(abi_t<%>**)this;
check_hresult(abiType->%(%));
auto const _winrt_abi_type = *(abi_t<%>**)this;
check_hresult(_winrt_abi_type->%(%));
}%
}
)";
Expand Down