[PATCH] D119525: [clang] Fix crash when array size is missing in initializer

Timm B├Ąder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 11 09:27:18 PST 2022

tbaeder marked 3 inline comments as done.
tbaeder added inline comments.

Comment at: clang/lib/AST/StmtPrinter.cpp:2135
   std::string TypeS;
-  if (Optional<Expr *> Size = E->getArraySize()) {
+  if (E->isArray()) {
     llvm::raw_string_ostream s(TypeS);
aaron.ballman wrote:
> tbaeder wrote:
> > I changed this just for clarity, not doing it did not cause any tests to fail. Not sure if this is tested at all.
> -ast-print is... pretty terrible (I've had half a mind to put up an RFC asking if we should remove it entirely, that's how unmaintained it is), so I suspect it's not tested.
Alright, I'll leave it at that then. I briefly tried to test the code but didn't succeed.



More information about the cfe-commits mailing list