Skip to content

Commit

Permalink
Remove workaround for Visual C++ code gen bug (#1118)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Mar 11, 2022
1 parent a7ee860 commit e0012b0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions cppwinrt/code_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1197,17 +1197,9 @@ namespace cppwinrt
method_signature signature{ method };
auto async_types_guard = w.push_async_types(signature.is_async());

//
// Note: this use of a lambda is a workaround for a Visual C++ compiler bug:
// https://developercommunity.visualstudio.com/content/problem/554130/incorrect-code-gen-when-invoking-a-conversion-oper.html
// Once fixed, revert the function body back to this:
//
// return static_cast<% const&>(*this).%(%);
//

std::string_view format = R"( inline auto %::%(%) const%
{
return [&](% const& winrt_impl_base) { return winrt_impl_base.%(%); }(*this);
return static_cast<% const&>(*this).%(%);
}
)";

Expand Down

0 comments on commit e0012b0

Please sign in to comment.