-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[lldb][NFC] Fix a build failure with MSVC #111231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb][NFC] Fix a build failure with MSVC #111231
Conversation
Building the original code failed with an error: ``` ...\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)' ```
@llvm/pr-subscribers-lldb Author: Igor Kudrin (igorkudrin) ChangesThis fixes a build error with msvc for code introduced in #106442:
Full diff: https://github.com/llvm/llvm-project/pull/111231.diff 1 Files Affected:
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;
};
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I guess. Is that constructor even necessary, given that it just forwards the argument to the base class, and we already have the forwarding using
declaration?
The constructor looks redundant at the moment, perhaps it is just a legacy from the early stages of patch #106442. Maybe some other constructors can also be reduced, for example, |
This constructor is more a leftover after a bunch of refactoring, your change LGTM! |
This fixes a build error with msvc for code introduced in #106442: