[PATCH] D132723: [Clang] Fix crash in coverage of if consteval.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 08:38:32 PDT 2022


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM, thanks for the fix!



================
Comment at: clang/lib/CodeGen/CoverageMappingGen.cpp:1407
       // The 'else' count applies to the area immediately after the 'then'.
-      Gap = findGapAreaBetween(getEnd(S->getThen()), getStart(Else));
+      auto Gap = findGapAreaBetween(getEnd(S->getThen()), getStart(Else));
       if (Gap)
----------------
cor3ntin wrote:
> aaron.ballman wrote:
> > 1) Pick a name which doesn't shadow
> > 2) Spell out the type instead of using `auto`
> `auto Gap...` was preexisting, I changed both instances. Both variables are in their own non nested scopes though.
Yeah, I somehow missed these were in different scopes!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132723



More information about the cfe-commits mailing list