diff --git a/src/program_builder.h b/src/program_builder.h index 400f9cdee7..7e2857892b 100644 --- a/src/program_builder.h +++ b/src/program_builder.h @@ -1149,12 +1149,16 @@ class ProgramBuilder { return func; } - /// Creates an ast::ReturnStatement with the input args - /// @param args arguments to construct a return statement with + /// Creates an ast::ReturnStatement with no return value /// @returns the return statement pointer - template - ast::ReturnStatement* Return(Args&&... args) { - return create(std::forward(args)...); + ast::ReturnStatement* Return() { return create(); } + + /// Creates an ast::ReturnStatement with the given return value + /// @param val the return value + /// @returns the return statement pointer + template + ast::ReturnStatement* Return(EXPR&& val) { + return create(Expr(std::forward(val))); } /// Creates a ast::Struct and type::Struct, registering the type::Struct with