clang/lib/Sema/SemaOpenMP.cpp:24351: pointless test ?
Static analyser cppcheck says:
clang/lib/Sema/SemaOpenMP.cpp:24351:57: style: Same expression 'DepType!=OMPC_DOACROSS_source' found multiple times in chain of '&&' operators. [duplicateExpression]
Source code is
if (DSAStack->getCurrentDirective() == OMPD_ordered &&
DepType != OMPC_DOACROSS_source && DepType != OMPC_DOACROSS_sink &&
DepType != OMPC_DOACROSS_sink_omp_cur_iteration &&
DepType != OMPC_DOACROSS_source_omp_cur_iteration &&
DepType != OMPC_DOACROSS_source) {
There is just a chance some other identifier was intended. On the other hand, if it is simple duplication, it can be removed.
@llvm/issue-subscribers-clang-frontend
Author: None (dcb314)
clang/lib/Sema/SemaOpenMP.cpp:24351:57: style: Same expression 'DepType!=OMPC_DOACROSS_source' found multiple times in chain of '&&' operators. [duplicateExpression]
Source code is
if (DSAStack->getCurrentDirective() == OMPD_ordered && DepType != OMPC_DOACROSS_source && DepType != OMPC_DOACROSS_sink && DepType != OMPC_DOACROSS_sink_omp_cur_iteration && DepType != OMPC_DOACROSS_source_omp_cur_iteration && DepType != OMPC_DOACROSS_source) {
There is just a chance some other identifier was intended. On the other hand, if it is simple duplication, it can be removed.
CC @jyu2-git who added this at f70967fd
@jyu2-git gentle ping
https://github.com/llvm/llvm-project/blob/6c4dedde08686edea9a1d5173313f44ef23ee38e/clang/lib/Sema/SemaOpenMP.cpp#L24592-L24596
I see. I will fix it. Thanks.