will fire on code such as:
cout << x == 0;
which the compiler will intrepret as
(cout << x) == 0;
This warning comes with two fixits attached to notes, one for parentheses to
silence the warning, and another to evaluate the comparison first.
llvm-svn: 179662
These run lines originally tested that the fix-its were properly applied.
Originally, the fixits were attached to warnings and were applied by -fixit.
Now, the fixits are attached to notes, so nothing happens. These run lines
still manage to pass since Clang will produce an empty output which gets piped
back to Clang. Then Clang produces no error on an empty input.
llvm-svn: 179131
This appears to be consistent with GCC's implementation of the same warning
under -Wparentheses. Suppressing a << b + c for cases where 'a' is a user
defined type for compatibility with C++ stream IO. Otherwise suggest
parentheses around the addition or subtraction subexpression.
(this came up when MSVC was complaining (incorrectly, so far as I can tell)
about a perceived violation of this within the LLVM codebase, PR14001)
llvm-svn: 165283
pretty. In particular this makes it much easier for me to read messages
such as:
x.cc:42: ?: has lower ...
Where I'm inclined to associate the third ':' with a missing column
number, but in fact column numbers have been turned off. Similar
punctuation collisions happened elsewhere as well.
llvm-svn: 133121
This is a follow-up to r132565, and should address the rest of PR9969:
Warn about cases such as
int foo(A a, bool b) {
return a + b ? 1 : 2; // user probably meant a + (b ? 1 : 2);
}
also when + is an overloaded operator call.
llvm-svn: 132784
Warn in cases such as "x + someCondition ? 42 : 0;",
where the condition expression looks arithmetic, and has
a right-hand side that looks boolean.
This (partly) addresses http://llvm.org/bugs/show_bug.cgi?id=9969
llvm-svn: 132565