https://github.com/HerrCai0907 created 
https://github.com/llvm/llvm-project/pull/120597

`llvm::Error` must be consumed, otherwise it will cause trap during destructor


>From de02085e535f21c74e8a7efb26272590398ddddb Mon Sep 17 00:00:00 2001
From: Congcong Cai <congcongcai0...@163.com>
Date: Fri, 20 Dec 2024 00:10:03 +0800
Subject: [PATCH] [clang analyzer]consume `llvm::Error`

`llvm::Error` must be consumed, otherwise it will cause trap during destructor
---
 clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp 
b/clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp
index 71268af22e2424..e8cf367b833467 100644
--- a/clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp
@@ -81,7 +81,7 @@ class TextDiagnostics : public PathDiagnosticConsumer {
 
         if (llvm::Error Err = Repls.add(Repl)) {
           llvm::errs() << "Error applying replacement " << Repl.toString()
-                       << ": " << Err << "\n";
+                       << ": " << llvm::toString(std::move(Err)) << "\n";
         }
       }
     };

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to