[PATCH] D65192: [Sema] Disable some enabled-by-default -Wparentheses diagnostics
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 29 19:19:52 PDT 2019
MaskRay marked an inline comment as done.
MaskRay added inline comments.
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:5654-5656
def warn_addition_in_bitshift : Warning<
"operator '%0' has lower precedence than '%1'; "
+ "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>, DefaultIgnore;
> Do you have evidence that this warning has a significant false-positive rate? In my experience it's very common for people to think of `<<` as being a multiplication-like operator and be surprised when it turns out to have lower precedence than addition.
warn_addition_in_bitshift has many false positives. Some results when searching for `[-Wshift-op-parentheses]` and the most common diagnostic `operator '<<' has lower precedence than '+'; '+' will be evaluated first`:
CHANGES SINCE LAST ACTION
More information about the cfe-commits