[PATCH] D61838: [Sema] Suppress additional warnings for C's zero initializer
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat May 18 15:55:34 PDT 2019
rsmith added inline comments.
================
Comment at: clang/lib/AST/Expr.cpp:2092-2096
const IntegerLiteral *Lit = dyn_cast<IntegerLiteral>(getInit(0));
+ if (!Lit) {
+ if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(getInit(0)))
+ Lit = dyn_cast<IntegerLiteral>(ICE->getSubExpr());
+ }
----------------
Use `Expr::IgnoreImplicit` rather than checking for an `ImplicitCastExpr` here:
```
const IntegerLiteral *Lit = dyn_cast<IntegerLiteral>(getInit(0)->IgnoreImplicit());
```
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61838/new/
https://reviews.llvm.org/D61838
More information about the cfe-commits
mailing list