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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to