[clang-tidy] SimplifyBoolenExpr doesn't add parens if unary negotiation is of ExprWit...
authorZinovy Nis <zinovy.nis@gmail.com>
Tue, 22 May 2018 17:24:28 +0000 (17:24 +0000)
committerZinovy Nis <zinovy.nis@gmail.com>
Tue, 22 May 2018 17:24:28 +0000 (17:24 +0000)
commit9bfe932c541cdbe8978f399e79ec95bb61e94f71
tree5bce27df82899cc575af169fd9a60c6ccadf1493
parent65a91288fcbf128538bd1bd227de5f8bb29784b5
[clang-tidy] SimplifyBoolenExpr doesn't add parens if unary negotiation is of ExprWithCleanups type

bool foo(A &S) {
  if (S != (A)S)
    return false;
  return true;
}
is fixed into (w/o this patch)

...
return !S != (A)S; // negotiation affects first operand only
}
instead of (with this patch)

...
return S == (A)S; // note == instead of !=
}

Differential Revision: https://reviews.llvm.org/D47122

llvm-svn: 333003
clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
clang-tools-extra/test/clang-tidy/readability-simplify-bool-expr.cpp