<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95300>95300</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang/lib/Lex/PPDirectives.cpp:3765:43: style: Redundant condition
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
code-quality
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Static analyser cppcheck says:
clang/lib/Lex/PPDirectives.cpp:3765:43: style: Redundant condition: !WaitingForInnerCloseParen. 'A || (!A && B)' is equivalent to 'A || B' [redundantCondition]
Source code is
while (CurTok.isNot(tok::eod) &&
(WaitingForInnerCloseParen ||
(!WaitingForInnerCloseParen && CurTok.isNot(tok::r_paren)))) {
Maybe better code:
while (CurTok.isNot(tok::eod) &&
(WaitingForInnerCloseParen ||
CurTok.isNot(tok::r_paren))) {
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysk1tr3DAQhX_N-EXE2CPLXj_4YS8YCm0JTaGPRZfJrhrFciR52_33xRun2aaklFBjfJHm6MwncWSMdj8QdSA2IHaZnNLBh85oxcsqU96cupskk9VMDtKdIgWmx1EfSN-xKE8R-BqKHRTLUzs57AF7ZxVg_55-APbX1zsbSCd7pJjrcQS-5k0tgK8rDnzNYjo5mj8-kZkGI4fEtB-MTdYP8zBg-UXaZId978O7YaCwdT7StQw05AywWTNottBsGeAKsJwVNWDNNoAtYMNsZPQw2aN0NCSW_G-azVwBYhOezLe_vMXuEu3GT0ET094Qs_Fyhn0_WEez-3YKn_1dbuNHnwBXyd_N-8PX5A1gu_S1iABXr2ItzS2VL65Hyr9oH-lf6yV8Heey894sN4Nmcwn0QZ4UMUUpzcftDb045bcB_0HxNvx_5XqGykzHTctbmVFXNuUKERsU2aGrBTeGY2maRpXFrdGVWCnRmpXCoq5IZLbDAquiLhGLQqDI1W2pWl43qKQqqKqgKuheWpc7d7zPfdhnNsaJulbwosicVOTiOVqISzQQcDv_eUNXD5N0Np3mQbHLQjcvcqWmfYSqcDam-LxssslR97_jlU3BdYeUxnOOsQfs9zYdJpVrfz_7uOPT62oM_hvpBNifESNg_0h57PBnAAAA___nX0Lu">