-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Misc] NFC: Fix -Wdefaulted-function-deleted warnings #20649
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,11 @@ template <typename K, typename V> class TreeScopedHashTableVal { | |
TreeScopedHashTableVal(const K &Key, const V &Val) : Key(Key), Val(Val) {} | ||
|
||
public: | ||
TreeScopedHashTableVal(const TreeScopedHashTableVal &) = delete; | ||
TreeScopedHashTableVal(TreeScopedHashTableVal &&) = delete; | ||
TreeScopedHashTableVal &operator=(const TreeScopedHashTableVal &) = delete; | ||
TreeScopedHashTableVal &operator=(TreeScopedHashTableVal &&) = delete; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule of Five says it's worth mentioning the destructor here too. |
||
|
||
const K &getKey() const { return Key; } | ||
const V &getValue() const { return Val; } | ||
V &getValue() { return Val; } | ||
|
@@ -144,6 +149,11 @@ class TreeScopedHashTableDetachedScope { | |
const ImplTy *getImpl() { return DetachedImpl; } | ||
|
||
public: | ||
TreeScopedHashTableDetachedScope &operator=( | ||
const TreeScopedHashTableDetachedScope &) = default; | ||
TreeScopedHashTableDetachedScope &operator=( | ||
TreeScopedHashTableDetachedScope &&) = default; | ||
|
||
TreeScopedHashTableDetachedScope() : DetachedImpl(0) {} | ||
|
||
TreeScopedHashTableDetachedScope(TreeScopedHashTableDetachedScope &&Other) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -524,7 +524,6 @@ struct LLVM_LIBRARY_VISIBILITY ExclusiveBorrowFormalAccess : FormalAccess { | |
ExclusiveBorrowFormalAccess & | ||
operator=(ExclusiveBorrowFormalAccess &&) = default; | ||
|
||
ExclusiveBorrowFormalAccess() = default; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The superclass doesn't have a default constructor, so the subclass can't either. |
||
ExclusiveBorrowFormalAccess(SILLocation loc, | ||
std::unique_ptr<LogicalPathComponent> &&comp, | ||
ManagedValue base, | ||
|
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.
Rule of Zero says that we should not declare this explicitly. If you think it's important, we should follow the Rule of Five instead.
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.
CharSourceRange() {}
is effectivelyCharSourceRange() = default
, right? If so, then yes, I can flush out the rule-of-five.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.
Rule of Five doesn't include the default constructor anyway, so just deleting this newest line is fine. The reason to keep it would be to see if we regress, I guess, but then we should definitely include all five
= default
special members.