================
@@ -5678,8 +5678,9 @@ bool Compiler<Emitter>::visitReturnStmt(const ReturnStmt
*RS) {
return this->emitRet(*ReturnType, RS);
}
- if (RE->getType()->isVoidType()) {
- if (!this->visit(RE))
+ if (RE->getType()->isVoidType() ||
+ (CompilingFunction &&
CompilingFunction->getReturnType()->isVoidType())) {
+ if (!this->discard(RE))
return false;
} else {
InitLinkScope<Emitter> ILS(this, InitLink::RVO());
----------------
tbaederr wrote:
Looks the same to me.
https://github.com/llvm/llvm-project/pull/176550
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits