[PATCH] D47687: fix: [Bug 18971] - Missing -Wparentheses warning

2018-06-04 Thread eric via Phabricator via cfe-commits
Higuoxing added a comment. Thanks for reviewing! I think the logic that *do not emit warning in macros* is not so proper ... Best Regards, Xing https://reviews.llvm.org/D47687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D47687: fix: [Bug 18971] - Missing -Wparentheses warning

2018-06-04 Thread eric via Phabricator via cfe-commits
Higuoxing updated this revision to Diff 149766. Higuoxing edited the summary of this revision. Higuoxing added a comment. Update with test cases :) https://reviews.llvm.org/D47687 Files: lib/Sema/SemaExpr.cpp test/Sema/parentheses.c Index: test/Sema/parentheses.c

[PATCH] D47687: fix: [Bug 18971] - Missing -Wparentheses warning

2018-06-03 Thread eric via Phabricator via cfe-commits
Higuoxing added a comment. In https://reviews.llvm.org/D47687#1120226, @lebedev.ri wrote: > In https://reviews.llvm.org/D47687#1120213, @Higuoxing wrote: > > > As for some test cases, > > > The tests need to be within the patch itself, in this case > i guess that should go into

[PATCH] D47687: fix: [Bug 18971] - Missing -Wparentheses warning

2018-06-03 Thread eric via Phabricator via cfe-commits
Higuoxing added a comment. As for some test cases, $ cat a.cc #include #include #define bar(x) \ ( \ ( std::cout << x ) \ ) bool x; int val; void foo(bool b) { std::cout << b << std::endl; } int main () { foo(x && val == 4 || (!x &&

[PATCH] D47687: fix: [Bug 18971] - Missing -Wparentheses warning

2018-06-03 Thread eric via Phabricator via cfe-commits
Higuoxing created this revision. Herald added a subscriber: cfe-commits. Higuoxing edited the summary of this revision. Hi, As you see, to avoid some expression like assert(x || y && "some messages"); clang will skip all the parentheses check if the expression is in `macro`; and this rule is