[clang] [clang-repl] Fix the process return code if diagnostics occurred. (PR #89879)

Stefan Gränitz via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 24 08:32:08 PDT 2024


================
@@ -241,18 +243,13 @@ int main(int argc, const char **argv) {
         break;
       }
       if (Input == R"(%undo)") {
-        if (auto Err = Interp->Undo()) {
+        if (auto Err = Interp->Undo())
           llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: ");
-          HasError = true;
-        }
       } else if (Input.rfind("%lib ", 0) == 0) {
-        if (auto Err = Interp->LoadDynamicLibrary(Input.data() + 5)) {
+        if (auto Err = Interp->LoadDynamicLibrary(Input.data() + 5))
           llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: ");
-          HasError = true;
----------------
weliveindetail wrote:

This did include errors like "file not found" in interactive mode

https://github.com/llvm/llvm-project/pull/89879


More information about the cfe-commits mailing list