[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-06-14 Thread Raphael Isemann via Phabricator via cfe-commits
teemperor added a comment. Everything beside this last test case seems to be handled. And from what I remember there was a longer discussion how to properly handle this case and so this review got stuck. Can we add this last test case with a FIXME and then get this merged? https://reviews.llv

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-05-01 Thread Yuka Takahashi via Phabricator via cfe-commits
yamaguchi added inline comments. Comment at: lib/Sema/SemaInit.cpp:875 if (!VerifyOnly) { StructuredSubobjectInitList->setType(T); ruiu wrote: > Is it intentional that you run the new code only when !VerifyOnly? I think VerifyOnly is used to check if it

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-05-01 Thread Yuka Takahashi via Phabricator via cfe-commits
yamaguchi updated this revision to Diff 97398. yamaguchi marked 2 inline comments as done. yamaguchi added a comment. Fixed spaces and changed SpellingLoc from two lines to one line. https://reviews.llvm.org/D32646 Files: lib/Sema/SemaInit.cpp test/Sema/warn-missing-braces.c Index: test/S

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-05-01 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: test/Sema/warn-missing-braces.c:21 + +#endif This looks shorter than the test I pasted on the bug. Does it get the corner case right that my patch on that bug didn't get right? https://reviews.llvm.org/D32646 __

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added inline comments. Comment at: lib/Sema/SemaInit.cpp:897 +SemaRef.getSourceManager().isInSystemHeader(SpellingLoc)) + return; SemaRef.Diag(StructuredSubobjectInitList->getLocStart(), Please use clang-format to format your cod

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added inline comments. Comment at: lib/Sema/SemaInit.cpp:875 if (!VerifyOnly) { StructuredSubobjectInitList->setType(T); Is it intentional that you run the new code only when !VerifyOnly? Comment at: lib/Sema/SemaInit.cpp:890-891

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Yuka Takahashi via Phabricator via cfe-commits
yamaguchi updated this revision to Diff 97228. yamaguchi added a comment. Add check if there is -Wmissing-braces enabled or not. https://reviews.llvm.org/D32646 Files: lib/Sema/SemaInit.cpp test/Sema/warn-missing-braces.c Index: test/Sema/warn-missing-braces.c

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. Did you incorporate the comment from here: https://bugs.llvm.org/show_bug.cgi?id=24007#c2 https://reviews.llvm.org/D32646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/li

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Yuka Takahashi via Phabricator via cfe-commits
yamaguchi updated this revision to Diff 97227. yamaguchi marked 5 inline comments as done. yamaguchi added a comment. Changed to early return. https://reviews.llvm.org/D32646 Files: lib/Sema/SemaInit.cpp test/Sema/warn-missing-braces.c Index: test/Sema/warn-missing-braces.c ==

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. I don't think we should worry about that. Please also see: http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code https://reviews.llvm.org/D32646 ___ cfe-commits mailing list cfe-commit

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Yuka Takahashi via Phabricator via cfe-commits
yamaguchi updated this revision to Diff 97224. yamaguchi added a comment. @v.g.vassilev I don't think early return is good idea, because someone might want to add some code under this function in the future. https://reviews.llvm.org/D32646 Files: lib/Sema/SemaInit.cpp test/Sema/warn-missi

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Yuka Takahashi via Phabricator via cfe-commits
yamaguchi added inline comments. Comment at: lib/Sema/SemaInit.cpp:892 + SpellingLoc = SemaRef.getSourceManager().getSpellingLoc(SpellingLoc); + if (!(SpellingLoc.isValid() && +SemaRef.getSourceManager().isInSystemHeader(SpellingLoc))) { ya

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Yuka Takahashi via Phabricator via cfe-commits
yamaguchi added inline comments. Comment at: lib/Sema/SemaInit.cpp:892 + SpellingLoc = SemaRef.getSourceManager().getSpellingLoc(SpellingLoc); + if (!(SpellingLoc.isValid() && +SemaRef.getSourceManager().isInSystemHeader(SpellingLoc))) { v.

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added inline comments. Comment at: lib/Sema/SemaInit.cpp:892 + SpellingLoc = SemaRef.getSourceManager().getSpellingLoc(SpellingLoc); + if (!(SpellingLoc.isValid() && +SemaRef.getSourceManager().isInSystemHeader(SpellingLoc))) {

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Yuka Takahashi via Phabricator via cfe-commits
yamaguchi marked 2 inline comments as done. yamaguchi added inline comments. Comment at: lib/Sema/SemaInit.cpp:892 + SpellingLoc = SemaRef.getSourceManager().getSpellingLoc(SpellingLoc); + if (!(SpellingLoc.isValid() && +SemaRef.getSourceManager().isInSyste

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-30 Thread Vassil Vassilev via Phabricator via cfe-commits
v.g.vassilev added a comment. LGTM, modulo the comment. Comment at: lib/Sema/SemaInit.cpp:892 + SpellingLoc = SemaRef.getSourceManager().getSpellingLoc(SpellingLoc); + if (!(SpellingLoc.isValid() && +SemaRef.getSourceManager().isInSystemHeader(SpellingLoc

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-28 Thread Yuka Takahashi via Phabricator via cfe-commits
yamaguchi updated this revision to Diff 97182. yamaguchi added a comment. Update testcase. Made it minimal. https://reviews.llvm.org/D32646 Files: lib/Sema/SemaInit.cpp test/Sema/warn-missing-braces.c Index: test/Sema/warn-missing-braces.c =

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-28 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added inline comments. Comment at: test/Sema/warn-missing-braces.c:6-11 +typedef struct _GUID { + unsigned Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; +} GUID; You can simplify this, can't you? It seems something li

[PATCH] D32646: Fix a bug that -Wmissing-braces fires on system headers

2017-04-28 Thread Yuka Takahashi via Phabricator via cfe-commits
yamaguchi created this revision. This is an update patch for bug [1]. -Wmissing-braces should not fire for system headers. [1] https://bugs.llvm.org/show_bug.cgi?id=24007 https://reviews.llvm.org/D32646 Files: lib/Sema/SemaInit.cpp test/Sema/warn-missing-braces.c Index: test/Sema/warn-m