Skip to content

Commit a618059

Browse files
committed
Fix integer fields causing impl promotion
1 parent 136cb3b commit a618059

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cppwinrt/code_writers.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,6 +2861,8 @@ struct WINRT_IMPL_EMPTY_BASES produce_dispatch_to_overridable<T, D, %>
28612861

28622862
static write_structs_result write_structs(writer& w, std::vector<TypeDef> const& types)
28632863
{
2864+
write_structs_result result{};
2865+
28642866
auto format = R"( struct %
28652867
{
28662868
% };
@@ -2876,7 +2878,7 @@ struct WINRT_IMPL_EMPTY_BASES produce_dispatch_to_overridable<T, D, %>
28762878

28772879
if (types.empty())
28782880
{
2879-
return {};
2881+
return result;
28802882
}
28812883

28822884
struct complex_struct
@@ -2942,7 +2944,6 @@ struct WINRT_IMPL_EMPTY_BASES produce_dispatch_to_overridable<T, D, %>
29422944
}
29432945
}
29442946

2945-
write_structs_result result;
29462947
auto cpp_namespace = w.write_temp("@", w.type_namespace);
29472948

29482949
for (auto&& type : structs)
@@ -2963,7 +2964,7 @@ struct WINRT_IMPL_EMPTY_BASES produce_dispatch_to_overridable<T, D, %>
29632964

29642965
for (auto&& field : type.fields)
29652966
{
2966-
if (field.second.find(':') == std::string::npos)
2967+
if (field.second.find(':') == std::string::npos || starts_with(field.second, "std::"))
29672968
{
29682969
continue;
29692970
}

0 commit comments

Comments
 (0)