Commit 8dc7b982 authored by Mark de Wever's avatar Mark de Wever
Browse files

[NFC] Fixes -Wrange-loop-analysis warnings

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

Differential Revision: https://reviews.llvm.org/D71857
parent 9b24dad6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ static void genMarkdown(const RecordInfo &I, llvm::raw_ostream &OS) {

  if (!I.Members.empty()) {
    writeHeader("Members", 2, OS);
    for (const auto Member : I.Members) {
    for (const auto &Member : I.Members) {
      std::string Access = getAccess(Member.Access);
      if (Access != "")
        writeLine(Access + " " + Member.Type.Name + " " + Member.Name, OS);
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ void SlicingCheck::DiagnoseSlicedOverriddenMethods(
    const CXXRecordDecl &BaseDecl) {
  if (DerivedDecl.getCanonicalDecl() == BaseDecl.getCanonicalDecl())
    return;
  for (const auto &Method : DerivedDecl.methods()) {
  for (const auto *Method : DerivedDecl.methods()) {
    // Virtual destructors are OK. We're ignoring constructors since they are
    // tagged as overrides.
    if (isa<CXXConstructorDecl>(Method) || isa<CXXDestructorDecl>(Method))
+1 −1
Original line number Diff line number Diff line
@@ -792,7 +792,7 @@ void IdentifierNamingCheck::check(const MatchFinder::MatchResult &Result) {
  }

  if (const auto *Decl = Result.Nodes.getNodeAs<UsingDecl>("using")) {
    for (const auto &Shadow : Decl->shadows()) {
    for (const auto *Shadow : Decl->shadows()) {
      addUsage(NamingCheckFailures, Shadow->getTargetDecl(),
               Decl->getNameInfo().getSourceRange());
    }
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ using llvm::SmallPtrSet;
namespace {

template <typename S> bool isSetDifferenceEmpty(const S &S1, const S &S2) {
  for (const auto &E : S1)
  for (auto E : S1)
    if (S2.count(E) == 0)
      return false;
  return true;
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ ExceptionAnalyzer::ExceptionInfo ExceptionAnalyzer::throwsException(

  auto Result = ExceptionInfo::createUnknown();
  if (const auto *FPT = Func->getType()->getAs<FunctionProtoType>()) {
    for (const QualType Ex : FPT->exceptions())
    for (const QualType &Ex : FPT->exceptions())
      Result.registerException(Ex.getTypePtr());
  }
  return Result;
Loading