Skip to content

Commit e0012b0

Browse files
authored
Remove workaround for Visual C++ code gen bug (#1118)
1 parent a7ee860 commit e0012b0

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

cppwinrt/code_writers.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,17 +1197,9 @@ namespace cppwinrt
11971197
method_signature signature{ method };
11981198
auto async_types_guard = w.push_async_types(signature.is_async());
11991199

1200-
//
1201-
// Note: this use of a lambda is a workaround for a Visual C++ compiler bug:
1202-
// https://developercommunity.visualstudio.com/content/problem/554130/incorrect-code-gen-when-invoking-a-conversion-oper.html
1203-
// Once fixed, revert the function body back to this:
1204-
//
1205-
// return static_cast<% const&>(*this).%(%);
1206-
//
1207-
12081200
std::string_view format = R"( inline auto %::%(%) const%
12091201
{
1210-
return [&](% const& winrt_impl_base) { return winrt_impl_base.%(%); }(*this);
1202+
return static_cast<% const&>(*this).%(%);
12111203
}
12121204
)";
12131205

0 commit comments

Comments
 (0)