Higuoxing added a comment.
Thanks for reviewing! I think enabling parentheses-checking in macros could be
helpful, and `assert(something)` is widely used : )
https://reviews.llvm.org/D47687
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
ht
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
http://lists.ll
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
=
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 `clang/test/Sema/
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 && v
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