[PATCH] D85193: [clang] Do not use an invalid expression to update the initializer.
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 11 09:58:41 PDT 2020
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM!
================
Comment at: clang/lib/Sema/SemaInit.cpp:3088
// No structured initializer list to update
if (!StructuredList)
return;
----------------
ArcsinX wrote:
> aaron.ballman wrote:
> > I would move the check up to here as the only time we should get a null expression is if something else has gone wrong (and update the comment as well).
> Could we add `expr` check after `return`? As far as we need to increment `StructuredIndex` in that case.
Ack, sorry about my think-o, you're absolutely correct!
>From what I can tell, `updateInit()` is resilient to a null `Expr*`, so your code is correct as-is. It looked odd to my eyes because it made me wonder if we need to still issue the diagnostic given the comment. Leaving your code as-is and updating the adjacent comment would also solve my concern.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85193/new/
https://reviews.llvm.org/D85193
More information about the cfe-commits
mailing list