[Lldb-commits] [PATCH] D121844: Applying clang-tidy modernize-use-equals-default over LLDB

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 29 14:11:49 PDT 2022

shafik marked 2 inline comments as done.
shafik added inline comments.

Comment at: lldb/source/Core/Value.cpp:667
-const ValueList &ValueList::operator=(const ValueList &rhs) {
+const ValueList &ValueList::operator=(const ValueList &rhs) {  // NOLINT(modernize-use-equals-default)
   m_values = rhs.m_values;
labath wrote:
> shafik wrote:
> > I have to look into why we return a `const &` here. We do this in a few other places too.
> I don't think there's a good reason for that. Most people aren't aware that built-in assignment operators return lvalues. And some of the people who are aware of that think that it's a bad idea, so they make sure their operators don't do it...
It produced build errors, so some of the users are relying on this. I didn't want to plumb into this since it was orthogonal to the change.

Comment at: lldb/source/Host/macosx/cfcpp/CFCMutableArray.cpp:18
 CFCMutableArray::CFCMutableArray(const CFCMutableArray &rhs)
-    : CFCReleaser<CFMutableArrayRef>(rhs) // NOTE: this won't make a copy of the
+    : CFCReleaser<CFMutableArrayRef>(rhs) // NOLINT(modernize-use-equals-default)
+                                          // NOTE: this won't make a copy of the
labath wrote:
> Why suppress this?
I wanted to preserve the comment since someone thought it was important.



More information about the lldb-commits mailing list