[PATCH] D28148: [Sema] Suppress warnings for C's zero initializer

S. Gilles via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 01:44:45 PST 2017


sgilles marked an inline comment as done.
sgilles added a comment.

Thanks to danielmarjamaki and rsmith for comments, which I think this diff addresses.  I have not done an extensive search of the codebase for places where `isSyntacticForm()` would be useful, but there don't seem to be any callers of `getSyntacticForm()` which used it in the way I did, so I believe that is okay.



================
Comment at: lib/AST/Expr.cpp:1887
+bool InitListExpr::isIdiomaticZeroInitializer(const LangOptions &LangOpts) const {
+  assert(!getSyntacticForm() && "only test syntactic form as zero initializer");
+
----------------
rsmith wrote:
> `!isSyntacticForm()` would be preferable here instead of `!getSyntacticForm()`.
I believe `isSyntacticForm()` makes sense here - please correct me if I've misunderstood.


https://reviews.llvm.org/D28148





More information about the cfe-commits mailing list