http://llvm.org/bugs/show_bug.cgi?id=18971
Bug ID: 18971
Summary: Missing -Wparentheses warning
Product: clang
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Classification: Unclassified
$ cat tmp/warning/a.cc
#include <cassert>
bool x;
int val;
void foo() {
assert(x && val == 4 || (!x && val == 5));
}
$ gcc-4.8.2-inst/bin/g++ -c tmp/warning/a.cc -Wall -o a.o
In file included from /gcc-4.8.2-inst/include/c++/4.8.2/cassert:43:0,
from tmp/warning/a.cc:1:
tmp/warning/a.cc: In function ‘void foo()’:
tmp/warning/a.cc:5:12: warning: suggest parentheses around ‘&&’ within ‘||’
[-Wparentheses]
assert(x && val == 4 || (!x && val == 5));
^
$ ./bin/clang++ -c tmp/warning/a.cc -Wall -o a.o
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs