Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class ExpandModularHeadersPPCallbacks : public PPCallbacks {
std::unique_ptr<Preprocessor> PP;
bool EnteredMainFile = false;
bool StartedLexing = false;
Token CurrentToken;
Token CurrentToken = Token();
};

} // namespace tooling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void FloatLoopCounterCheck::registerMatchers(MatchFinder *Finder) {

void FloatLoopCounterCheck::check(const MatchFinder::MatchResult &Result) {
const auto *FS = Result.Nodes.getNodeAs<ForStmt>("for");
if (!FS) return; // Check if FS is null and exit if it is.
Comment thread
zahiraam marked this conversation as resolved.
Outdated

diag(FS->getInc()->getBeginLoc(), "loop induction expression should not have "
"floating-point type")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ void ProBoundsAvoidUncheckedContainerAccessCheck::check(
// Case: a.operator[](i) or a->operator[](i)
const auto *Callee = dyn_cast<MemberExpr>(MCE->getCallee());
Comment thread
zahiraam marked this conversation as resolved.
Outdated

if (!Callee) {
diag(MatchedExpr->getCallee()->getBeginLoc(), "invalid member expression")
<< MatchedExpr->getCallee()->getSourceRange();
return;
}

if (FixMode == At) {
// Cases: a.operator[](i) => a.at(i) and a->operator[](i) => a->at(i)

Expand Down
Loading