From 551f476ec285e7d317f53f08de8b5e99f30c1cfa Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Wed, 19 Jun 2024 13:54:46 -0700 Subject: [PATCH] fix: add missing return type in context.add (#199) --- .../cpp_systems_header_codegen.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cpp_systems_header_codegen/cpp_systems_header_codegen.cc b/cpp_systems_header_codegen/cpp_systems_header_codegen.cc index cb412c4..aa7474a 100644 --- a/cpp_systems_header_codegen/cpp_systems_header_codegen.cc +++ b/cpp_systems_header_codegen/cpp_systems_header_codegen.cc @@ -297,7 +297,7 @@ static void write_context_add_specialize( block( ctx, std::format( - "template<> auto add<{0}>(const {0}& new_component)", + "template<> auto add<{0}>(const {0}& new_component) -> void", cpp_full_name ), [&] { @@ -305,9 +305,11 @@ static void write_context_add_specialize( } ); } else { - block(ctx, std::format("template<> auto add<{}>()", cpp_full_name), [&] { - ctx.write(std::format("_ctx.add<{}>()", cpp_full_name)); - }); + block( + ctx, + std::format("template<> auto add<{}>() -> void", cpp_full_name), + [&] { ctx.write(std::format("_ctx.add<{}>()", cpp_full_name)); } + ); } ctx.write("\n");