================
@@ -5678,11 +5678,10 @@ bool Compiler<Emitter>::visitReturnStmt(const 
ReturnStmt *RS) {
       return this->emitRet(*ReturnType, RS);
     }
 
-    if (RE->getType()->isVoidType()) {
-      if (!this->visit(RE))
+    if (RE->containsErrors() || RE->getType()->isVoidType()) {
+      if (!this->discard(RE))
         return false;
     } else {
-      InitLinkScope<Emitter> ILS(this, InitLink::RVO());
       // RVO - construct the value in the return location.
----------------
Serosh-commits wrote:

thanks i have updated the code to return false if RE->containsErrors() as u 
suggested 

https://github.com/llvm/llvm-project/pull/176550
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to