[PATCH] D123826: Fix size of flexible array initializers, and re-enable assertions.

2022-04-15 Thread Eli Friedman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4802edd1ac7a: Fix size of flexible array initializers, and re-enable assertions. (authored by efriedma). Changed prior to commit:

[PATCH] D123826: Fix size of flexible array initializers, and re-enable assertions.

2022-04-15 Thread Erich Keane via Phabricator via cfe-commits
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

[PATCH] D123826: Fix size of flexible array initializers, and re-enable assertions.

2022-04-15 Thread Eli Friedman via Phabricator via cfe-commits
efriedma 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) erichkeane wrote: > Same here You

[PATCH] D123826: Fix size of flexible array initializers, and re-enable assertions.

2022-04-15 Thread Erich Keane via Phabricator via cfe-commits
erichkeane accepted this revision. erichkeane added a comment. This revision is now accepted and ready to land. Couple nits, otherwise LGTM. Comment at: clang/lib/AST/Decl.cpp:2731 +return false; + auto *List = dyn_cast(getInit()->IgnoreParens()); + if (!List)

[PATCH] D123826: Fix size of flexible array initializers, and re-enable assertions.

2022-04-14 Thread Eli Friedman via Phabricator via cfe-commits
efriedma created this revision. efriedma added a reviewer: erichkeane. Herald added a project: All. efriedma requested review of this revision. Herald added a project: clang. In D123649 , I got the formula for getFlexibleArrayInitChars slightly wrong: the