We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e795d8 commit 3df57d4Copy full SHA for 3df57d4
source/cppfront.cpp
@@ -2104,6 +2104,14 @@ class cppfront
2104
assert(n.expr);
2105
2106
if (function_body_start != source_position{}) {
2107
+ if (!function_returns.empty() && function_returns.back() != nullptr && function_returns.back() != &single_anon) {
2108
+ errors.emplace_back(
2109
+ n.position(),
2110
+ "a function with named return value(s) must have a full { } body"
2111
+ );
2112
+ return;
2113
+ }
2114
+
2115
printer.print_cpp2(" { ", function_body_start);
2116
if (!function_void_ret) {
2117
printer.print_cpp2("return ", n.position());
0 commit comments