[PATCH] D78962: fix D78849 for g++ < 7.1

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 14:01:12 PDT 2020


nickdesaulniers marked 2 inline comments as done.
nickdesaulniers added a comment.

committed as 59acdf0aca10b78c5d3885f9721779585593074a <https://reviews.llvm.org/rG59acdf0aca10b78c5d3885f9721779585593074a>



================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:172
+        return llvm::any_of(
+            RS, [this](unsigned Reg) { return this->addRequired(Reg); });
       }
----------------
MaskRay wrote:
> I think `[&](unsigned Reg) { return addRequired(Reg); }` works as well...
> 
> There might be a `this` capturing bug in older GCC.
> 
> I seem to recall older MSVC has similar bugs.
Specifically, it's the case below that's problematic.  The use of `auto` is problematic.  If I use `&` capture and spell out the type, it works for g++-5.1, but I think spelling out the type hurts readability, compared to a call through `this`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78962





More information about the llvm-commits mailing list