[Lldb-commits] [lldb] [lldb][NFC] Fix a build failure with MSVC (PR #111231)

via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 4 22:16:24 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Igor Kudrin (igorkudrin)

<details>
<summary>Changes</summary>

This fixes a build error with msvc for code introduced in #<!-- -->106442:

```
...\lldb\source\Expression\DiagnosticManager.cpp(37): error C2668: 'llvm::ErrorInfo<lldb_private::ExpressionError,lldb_private::ExpressionErrorBase>::ErrorInfo': ambiguous call to overloaded function
...\llvm\include\llvm/Support/Error.h(357): note: could be 'llvm::ErrorInfo<lldb_private::ExpressionError,lldb_private::ExpressionErrorBase>::ErrorInfo(std::error_code)', which inherits 'lldb_private::CloneableECError::CloneableECError(std::error_code)' via base class 'lldb_private::ExpressionErrorBase'
...\llvm\include\llvm/Support/Error.h(357): note: or       'llvm::ErrorInfo<lldb_private::ExpressionError,lldb_private::ExpressionErrorBase>::ErrorInfo(std::error_code,std::string)', which inherits 'lldb_private::ExpressionErrorBase::ExpressionErrorBase(std::error_code,std::string)' via base class 'lldb_private::ExpressionErrorBase'
...\lldb\source\Expression\DiagnosticManager.cpp(37): note: while trying to match the argument list '(std::error_code)'
```

---
Full diff: https://github.com/llvm/llvm-project/pull/111231.diff


1 Files Affected:

- (modified) lldb/include/lldb/Utility/Status.h (+1-2) 


``````````diff
diff --git a/lldb/include/lldb/Utility/Status.h b/lldb/include/lldb/Utility/Status.h
index 3910c26d115a09..2911ffb804c6fb 100644
--- a/lldb/include/lldb/Utility/Status.h
+++ b/lldb/include/lldb/Utility/Status.h
@@ -83,8 +83,7 @@ class ExpressionErrorBase
     : public llvm::ErrorInfo<ExpressionErrorBase, CloneableECError> {
 public:
   using llvm::ErrorInfo<ExpressionErrorBase, CloneableECError>::ErrorInfo;
-  ExpressionErrorBase(std::error_code ec, std::string msg = {})
-      : ErrorInfo(ec) {}
+  ExpressionErrorBase(std::error_code ec) : ErrorInfo(ec) {}
   lldb::ErrorType GetErrorType() const override;
   static char ID;
 };

``````````

</details>


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


More information about the lldb-commits mailing list