diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp b/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp @@ -313,6 +313,8 @@ const auto *Member = dyn_cast(TheCall->getCallee()); if (!Member) return nullptr; + if (!Member->getMemberDecl()->getDeclName().isIdentifier()) + return nullptr; StringRef Name = Member->getMemberDecl()->getName(); if (!Name.consume_back(IsBegin ? "begin" : "end")) return nullptr; @@ -544,6 +546,7 @@ std::vector FixIts; if (VarNameFromAlias) { const auto *AliasVar = cast(AliasDecl->getSingleDecl()); + assert(AliasVar->getDeclName().isIdentifier()); VarName = AliasVar->getName().str(); // Use the type of the alias if it's not the same