[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop
Eugene Zelenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 23 06:48:38 PST 2020
Eugene.Zelenko added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:179
+ if (const auto *While = dyn_cast<WhileStmt>(LoopStmt)) {
+ if (const auto *LoopVarDecl = While->getConditionVariable()) {
+ if (const Expr *Init = LoopVarDecl->getInit()) {
----------------
Please don't use auto unless type is explicitly stated or iterator.
================
Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:194
+ if (const auto *While = dyn_cast<WhileStmt>(LoopStmt)) {
+ if (const auto *LoopVarDecl = While->getConditionVariable()) {
+ if (const Expr *Init = LoopVarDecl->getInit()) {
----------------
Please don't use auto unless type is explicitly stated or iterator.
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73270/new/
https://reviews.llvm.org/D73270
More information about the cfe-commits
mailing list