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

2017-09-07 Thread S. Gilles via Phabricator via cfe-commits
sgilles added a comment. Sure, if it still applies. I'm just a user and have no write access. Looks like I patched this locally and then forgot all about it. https://reviews.llvm.org/D28148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2017-09-06 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added a comment. This is not committed as far as I see.. do you have write permission or do you want that I commit it? https://reviews.llvm.org/D28148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2017-01-11 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki accepted this revision. danielmarjamaki added a reviewer: danielmarjamaki. danielmarjamaki added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D28148 ___ cfe-commits mailing list

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

2017-01-10 Thread S. Gilles via Phabricator via cfe-commits
sgilles marked an inline comment as done. sgilles added a comment. Ping - if there are no comments, could this be accepted? https://reviews.llvm.org/D28148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2017-01-03 Thread S. Gilles via Phabricator via cfe-commits
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

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

2017-01-03 Thread S. Gilles via Phabricator via cfe-commits
sgilles updated this revision to Diff 82849. sgilles marked 2 inline comments as done. sgilles added a comment. Address danielmarjamaki's and rsmith's comments (creating `InitListExpr::isSyntactic()` since it didn't already exist), as well as correct syntax of test so that it actually runs.

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

2017-01-02 Thread Richard Smith via Phabricator via cfe-commits
rsmith added a comment. Looks good to go once Daniel's and my comments are addressed. Thank you. Comment at: lib/AST/Expr.cpp:1887 +bool InitListExpr::isIdiomaticZeroInitializer(const LangOptions ) const { + assert(!getSyntacticForm() && "only test syntactic form as zero

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

2017-01-02 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added a comment. Thanks for working on these. imo these are false positives. Comment at: lib/AST/Expr.cpp:1893 + + const IntegerLiteral *lit = dyn_cast(getInit(0)); + if (!lit) { I would recommend capital first letter for this variable

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

2016-12-29 Thread S. Gilles via Phabricator via cfe-commits
sgilles updated this revision to Diff 82720. sgilles added a comment. Address rsmith's comments, in particular: factor out testing zero initializers to a method of `InitListExpr`; use `ParentIList` instead of `StructuredSubobjectInitList`. The warning is (still) not relaxed for C++ code. I

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

2016-12-29 Thread S. Gilles via Phabricator via cfe-commits
sgilles added a comment. Thank you for the comments, rsmith. I'm addressing them now, and I'll make sure to add your examples to the test case. I don't think `isSyntactic()` exists, so I'm using `!getSyntactic()` instead, which should have the desired effect. In

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

2016-12-29 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D28148#632541, @Quuxplusone wrote: > Re the language option: In https://reviews.llvm.org/D27163, @rsmith wrote: > > > Perhaps some catch-all "I want defined behavior for things that C defines > > even though I'm compiling in C++" flag would

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

2016-12-29 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added subscribers: rjmccall, Quuxplusone. Quuxplusone added a comment. Re the language option: In https://reviews.llvm.org/D27163, @rsmith wrote: > Perhaps some catch-all "I want defined behavior for things that C defines > even though I'm compiling in C++" flag would make sense

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

2016-12-29 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. Ops, it looks like I accidentally switched the diff back to the initial version and I have no idea how to switch it back :( I am very sorry about that, would you mind uploading the latest version again? https://reviews.llvm.org/D28148

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

2016-12-29 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 82626. https://reviews.llvm.org/D28148 Files: include/clang/Basic/LangOptions.def include/clang/Frontend/LangStandard.h include/clang/Frontend/LangStandards.def lib/Frontend/CompilerInvocation.cpp lib/Sema/SemaInit.cpp test/Sema/zero-initializer.c

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

2016-12-29 Thread Richard Smith via Phabricator via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaInit.cpp:884 +bool MissingBracesOkay = false; + +if (!SemaRef.getLangOpts().CPlusPlus && Remove empty line. Comment at: lib/Sema/SemaInit.cpp:885-892 +if

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

2016-12-28 Thread S. Gilles via Phabricator via cfe-commits
sgilles updated the summary for this revision. sgilles updated this revision to Diff 82638. sgilles added a comment. Instead of adding a language option to distinguish C, negatively check against C++. https://reviews.llvm.org/D28148 Files: lib/Sema/SemaInit.cpp test/Sema/zero-initializer.c

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

2016-12-28 Thread S. Gilles via Phabricator via cfe-commits
sgilles added a comment. In https://reviews.llvm.org/D28148#632002, @rsmith wrote: > Why are you adding a language option for this? Just use `!LangOpts.CPlusPlus`. I didn't want to have this change accidentally apply to other, non-C++ languages, since I'm not sure which languages would go

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

2016-12-28 Thread Richard Smith via Phabricator via cfe-commits
rsmith added a comment. Why are you adding a language option for this? Just use `!LangOpts.CPlusPlus`. https://reviews.llvm.org/D28148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2016-12-28 Thread S. Gilles via Phabricator via cfe-commits
sgilles created this revision. sgilles added reviewers: cfe-commits, rsmith, zaks.anna. Add ZeroInitializer as a language option, attached to all standards of C. Relax checks for -Wmissing-field-initializers and -Wmissing-braces so that, for such languages, assigning to a structure with { 0 }