[Lldb-commits] [PATCH] D116217: [lldb] Fix PR52702 by fixing Mangled::operator!

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 28 07:06:05 PST 2021


labath added inline comments.


================
Comment at: lldb/source/Core/Mangled.cpp:87
 //  { ...
-bool Mangled::operator!() const { return !m_mangled; }
+bool Mangled::operator!() const { return !m_mangled && !m_demangled; }
 
----------------
rZhBoYao wrote:
> labath wrote:
> > rZhBoYao wrote:
> > > Should we remove `Mangled::operator!` altogether? I find it less confusing without. 
> > Does `!mangled` work without it? Would it be sufficient to implement the `!` operator in terms of bool conversion function?
> Yes, I tried removing it and the unit test I added (`TEST(MangledTest, LogicalNotOperator)`) passed. Keeping it this way is fine tho. 
In that case, you should definitely remove it. We don't want to have two implementations that need to be kept in sync.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116217/new/

https://reviews.llvm.org/D116217



More information about the lldb-commits mailing list