erichkeane added inline comments.

================
Comment at: clang/lib/AST/Decl.cpp:2735
+  const Expr *FlexibleInit = List->getInit(List->getNumInits() - 1);
+  auto InitTy = Ctx.getAsConstantArrayType(FlexibleInit->getType());
+  if (!InitTy)
----------------
efriedma wrote:
> erichkeane wrote:
> > Same here
> You want something like this?
> 
> ```
> if (auto *List = dyn_cast<InitListExpr>(getInit()->IgnoreParens())) {
>   const Expr *FlexibleInit = List->getInit(List->getNumInits() - 1);
>   if (auto InitTy = Ctx.getAsConstantArrayType(FlexibleInit->getType())) {
>     return InitTy->getSize() != 0;
>   }
> }
> return false;
> ```
ah, shucks, i missed that this was an early exit (that is, I missed the '!').  
Disregard.  LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123826

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

Reply via email to