[clang-tools-extra] r289656 - modernize-use-auto NFC fixes
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 15 08:08:09 PST 2016
For most loop changes here applying modernize-loop-convert would be better
;)
On Wed, Dec 14, 2016 at 4:29 PM, Piotr Padlewski via cfe-commits <
cfe-commits at lists.llvm.org> wrote:
> Author: prazek
> Date: Wed Dec 14 09:29:23 2016
> New Revision: 289656
>
> URL: http://llvm.org/viewvc/llvm-project?rev=289656&view=rev
> Log:
> modernize-use-auto NFC fixes
>
> Modified:
> clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
> clang-tools-extra/trunk/clang-apply-replacements/lib/
> Tooling/ApplyReplacements.cpp
> clang-tools-extra/trunk/clang-query/Query.cpp
> clang-tools-extra/trunk/clang-query/QueryParser.cpp
> clang-tools-extra/trunk/clang-query/tool/ClangQuery.cpp
> clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/
> ProTypeMemberInitCheck.cpp
> clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/
> SpecialMemberFunctionsCheck.cpp
> clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp
> clang-tools-extra/trunk/clang-tidy/google/NonConstReferences.cpp
> clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp
> clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.cpp
> clang-tools-extra/trunk/clang-tidy/misc/MoveForwardingReferenceCheck.
> cpp
> clang-tools-extra/trunk/clang-tidy/misc/MultipleStatementMacroCheck.
> cpp
> clang-tools-extra/trunk/clang-tidy/misc/ThrowByValueCatchByReferenceCh
> eck.cpp
> clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
> clang-tools-extra/trunk/clang-tidy/modernize/UseOverrideCheck.cpp
> clang-tools-extra/trunk/clang-tidy/mpi/TypeMismatchCheck.cpp
> clang-tools-extra/trunk/clang-tidy/readability/
> ImplicitBoolCastCheck.cpp
> clang-tools-extra/trunk/clang-tidy/readability/
> NamespaceCommentCheck.cpp
> clang-tools-extra/trunk/clang-tidy/readability/
> RedundantDeclarationCheck.cpp
> clang-tools-extra/trunk/clang-tidy/readability/
> RedundantSmartptrGetCheck.cpp
> clang-tools-extra/trunk/include-fixer/find-all-
> symbols/FindAllSymbols.cpp
> clang-tools-extra/trunk/modularize/CoverageChecker.cpp
> clang-tools-extra/trunk/modularize/Modularize.cpp
> clang-tools-extra/trunk/modularize/ModularizeUtilities.cpp
> clang-tools-extra/trunk/modularize/ModuleAssistant.cpp
> clang-tools-extra/trunk/modularize/PreprocessorTracker.cpp
> clang-tools-extra/trunk/pp-trace/PPTrace.cpp
> clang-tools-extra/trunk/unittests/clang-tidy/
> ClangTidyDiagnosticConsumerTest.cpp
> clang-tools-extra/trunk/unittests/clang-tidy/NamespaceAliaserTest.cpp
> clang-tools-extra/trunk/unittests/clang-tidy/UsingInserterTest.cpp
>
> Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/change-namespace/ChangeNamespace.cpp?rev=289656&r1=289655&r2=289656&
> view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
> (original)
> +++ clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp Wed Dec
> 14 09:29:23 2016
> @@ -709,7 +709,7 @@ void ChangeNamespaceTool::fixTypeLoc(
> return;
> }
>
> - const Decl *DeclCtx = Result.Nodes.getNodeAs<Decl>("dc");
> + const auto *DeclCtx = Result.Nodes.getNodeAs<Decl>("dc");
> assert(DeclCtx && "Empty decl context.");
> replaceQualifiedSymbolInDeclContext(Result, DeclCtx->getDeclContext(),
> Start,
> End, FromDecl);
>
> Modified: clang-tools-extra/trunk/clang-apply-replacements/lib/
> Tooling/ApplyReplacements.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp?rev=
> 289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
> Wed Dec 14 09:29:23 2016
> @@ -124,9 +124,7 @@ static void reportConflict(
> bool applyAllReplacements(const std::vector<tooling::Replacement>
> &Replaces,
> Rewriter &Rewrite) {
> bool Result = true;
> - for (std::vector<tooling::Replacement>::const_iterator I =
> Replaces.begin(),
> - E =
> Replaces.end();
> - I != E; ++I) {
> + for (auto I = Replaces.begin(), E = Replaces.end(); I != E; ++I) {
> if (I->isApplicable()) {
> Result = I->apply(Rewrite) && Result;
> } else {
> @@ -293,8 +291,7 @@ RangeVector calculateChangedRanges(
>
> bool writeFiles(const clang::Rewriter &Rewrites) {
>
> - for (Rewriter::const_buffer_iterator BufferI = Rewrites.buffer_begin(),
> - BufferE = Rewrites.buffer_end();
> + for (auto BufferI = Rewrites.buffer_begin(), BufferE =
> Rewrites.buffer_end();
> BufferI != BufferE; ++BufferI) {
> StringRef FileName =
> Rewrites.getSourceMgr().getFileEntryForID(BufferI->
> first)->getName();
>
> Modified: clang-tools-extra/trunk/clang-query/Query.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-query/Query.cpp?rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-query/Query.cpp (original)
> +++ clang-tools-extra/trunk/clang-query/Query.cpp Wed Dec 14 09:29:23 2016
> @@ -86,14 +86,11 @@ bool MatchQuery::run(llvm::raw_ostream &
> }
> Finder.matchAST(AST->getASTContext());
>
> - for (std::vector<BoundNodes>::iterator MI = Matches.begin(),
> - ME = Matches.end();
> - MI != ME; ++MI) {
> + for (auto MI = Matches.begin(), ME = Matches.end(); MI != ME; ++MI) {
> OS << "\nMatch #" << ++MatchCount << ":\n\n";
>
> - for (BoundNodes::IDToNodeMap::const_iterator BI =
> MI->getMap().begin(),
> - BE =
> MI->getMap().end();
> - BI != BE; ++BI) {
> + for (auto BI = MI->getMap().begin(), BE = MI->getMap().end(); BI !=
> BE;
> + ++BI) {
> switch (QS.OutKind) {
> case OK_Diag: {
> clang::SourceRange R = BI->second.getSourceRange();
>
> Modified: clang-tools-extra/trunk/clang-query/QueryParser.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-query/QueryParser.cpp?rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-query/QueryParser.cpp (original)
> +++ clang-tools-extra/trunk/clang-query/QueryParser.cpp Wed Dec 14
> 09:29:23 2016
> @@ -158,9 +158,7 @@ QueryRef QueryParser::completeMatcherExp
> std::vector<MatcherCompletion> Comps = Parser::completeExpression(
> StringRef(Begin, End - Begin), CompletionPos - Begin, nullptr,
> &QS.NamedValues);
> - for (std::vector<MatcherCompletion>::iterator I = Comps.begin(),
> - E = Comps.end();
> - I != E; ++I) {
> + for (auto I = Comps.begin(), E = Comps.end(); I != E; ++I) {
> Completions.push_back(LineEditor::Completion(I->TypedText,
> I->MatcherDecl));
> }
> return QueryRef();
>
> Modified: clang-tools-extra/trunk/clang-query/tool/ClangQuery.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-query/tool/ClangQuery.cpp?rev=289656&r1=
> 289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-query/tool/ClangQuery.cpp (original)
> +++ clang-tools-extra/trunk/clang-query/tool/ClangQuery.cpp Wed Dec 14
> 09:29:23 2016
> @@ -77,17 +77,13 @@ int main(int argc, const char **argv) {
> QuerySession QS(ASTs);
>
> if (!Commands.empty()) {
> - for (cl::list<std::string>::iterator I = Commands.begin(),
> - E = Commands.end();
> - I != E; ++I) {
> + for (auto I = Commands.begin(), E = Commands.end(); I != E; ++I) {
> QueryRef Q = QueryParser::parse(*I, QS);
> if (!Q->run(llvm::outs(), QS))
> return 1;
> }
> } else if (!CommandFiles.empty()) {
> - for (cl::list<std::string>::iterator I = CommandFiles.begin(),
> - E = CommandFiles.end();
> - I != E; ++I) {
> + for (auto I = CommandFiles.begin(), E = CommandFiles.end(); I != E;
> ++I) {
> std::ifstream Input(I->c_str());
> if (!Input.is_open()) {
> llvm::errs() << argv[0] << ": cannot open " << *I << "\n";
>
> Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/
> ProTypeMemberInitCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp?
> rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
> Wed Dec 14 09:29:23 2016
> @@ -196,7 +196,7 @@ computeInsertions(const CXXConstructorDe
>
> // Add all fields between current field up until the next
> intializer.
> for (; Decl != std::end(OrderedDecls) && *Decl != InitDecl; ++Decl)
> {
> - if (const T *D = dyn_cast<T>(*Decl)) {
> + if (const auto *D = dyn_cast<T>(*Decl)) {
> if (DeclsToInit.count(D) > 0)
> Insertions.back().Initializers.emplace_back(getName(D));
> }
> @@ -208,7 +208,7 @@ computeInsertions(const CXXConstructorDe
>
> // Add remaining decls that require initialization.
> for (; Decl != std::end(OrderedDecls); ++Decl) {
> - if (const T *D = dyn_cast<T>(*Decl)) {
> + if (const auto *D = dyn_cast<T>(*Decl)) {
> if (DeclsToInit.count(D) > 0)
> Insertions.back().Initializers.emplace_back(getName(D));
> }
>
> Modified: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/
> SpecialMemberFunctionsCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.
> cpp?rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/
> SpecialMemberFunctionsCheck.cpp (original)
> +++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/
> SpecialMemberFunctionsCheck.cpp Wed Dec 14 09:29:23 2016
> @@ -82,8 +82,7 @@ join(ArrayRef<SpecialMemberFunctionsChec
>
> void SpecialMemberFunctionsCheck::check(
> const MatchFinder::MatchResult &Result) {
> - const CXXRecordDecl *MatchedDecl =
> - Result.Nodes.getNodeAs<CXXRecordDecl>("class-def");
> + const auto *MatchedDecl = Result.Nodes.getNodeAs<
> CXXRecordDecl>("class-def");
> if (!MatchedDecl)
> return;
>
>
> Modified: clang-tools-extra/trunk/clang-tidy/google/
> ExplicitConstructorCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/google/ExplicitConstructorCheck.cpp?
> rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp
> Wed Dec 14 09:29:23 2016
> @@ -75,8 +75,7 @@ static bool isStdInitializerList(QualTyp
> }
>
> void ExplicitConstructorCheck::check(const MatchFinder::MatchResult
> &Result) {
> - const CXXConstructorDecl *Ctor =
> - Result.Nodes.getNodeAs<CXXConstructorDecl>("ctor");
> + const auto *Ctor = Result.Nodes.getNodeAs<CXXConstructorDecl>("ctor");
> // Do not be confused: isExplicit means 'explicit' keyword is present,
> // isImplicit means that it's a compiler-generated constructor.
> if (Ctor->isOutOfLine() || Ctor->isImplicit() || Ctor->isDeleted() ||
>
> Modified: clang-tools-extra/trunk/clang-tidy/google/NonConstReferences.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/google/NonConstReferences.cpp?rev=
> 289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/google/NonConstReferences.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/google/NonConstReferences.cpp Wed
> Dec 14 09:29:23 2016
> @@ -56,7 +56,7 @@ void NonConstReferences::check(const Mat
> if (!Function->isCanonicalDecl())
> return;
>
> - if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(Function)) {
> + if (const auto *Method = dyn_cast<CXXMethodDecl>(Function)) {
> // Don't warn on implementations of an interface using references.
> if (Method->begin_overridden_methods() != Method->end_overridden_
> methods())
> return;
>
> Modified: clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/llvm/TwineLocalCheck.cpp?rev=289656&r1=289655&r2=289656&
> view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp (original)
> +++ clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp Wed Dec
> 14 09:29:23 2016
> @@ -25,7 +25,7 @@ void TwineLocalCheck::registerMatchers(M
> }
>
> void TwineLocalCheck::check(const MatchFinder::MatchResult &Result) {
> - const VarDecl *VD = Result.Nodes.getNodeAs<VarDecl>("variable");
> + const auto *VD = Result.Nodes.getNodeAs<VarDecl>("variable");
> auto Diag = diag(VD->getLocation(),
> "twine variables are prone to use-after-free bugs");
>
>
> Modified: clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/misc/ArgumentCommentCheck.cpp?rev=
> 289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.cpp Wed
> Dec 14 09:29:23 2016
> @@ -177,7 +177,7 @@ void ArgumentCommentCheck::checkCallArgs
> }
>
> void ArgumentCommentCheck::check(const MatchFinder::MatchResult &Result)
> {
> - const Expr *E = Result.Nodes.getNodeAs<Expr>("expr");
> + const auto *E = Result.Nodes.getNodeAs<Expr>("expr");
> if (const auto *Call = dyn_cast<CallExpr>(E)) {
> const FunctionDecl *Callee = Call->getDirectCallee();
> if (!Callee)
>
> Modified: clang-tools-extra/trunk/clang-tidy/misc/
> MoveForwardingReferenceCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/misc/MoveForwardingReferenceCheck.
> cpp?rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/misc/MoveForwardingReferenceCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/misc/MoveForwardingReferenceCheck.cpp
> Wed Dec 14 09:29:23 2016
> @@ -104,8 +104,7 @@ void MoveForwardingReferenceCheck::check
>
> // Get the FunctionDecl and FunctionTemplateDecl containing the function
> // parameter.
> - const FunctionDecl *FuncForParam =
> - dyn_cast<FunctionDecl>(ParmVar->getDeclContext());
> + const auto *FuncForParam = dyn_cast<FunctionDecl>(
> ParmVar->getDeclContext());
> if (!FuncForParam)
> return;
> const FunctionTemplateDecl *FuncTemplate =
>
> Modified: clang-tools-extra/trunk/clang-tidy/misc/
> MultipleStatementMacroCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/misc/MultipleStatementMacroCheck.
> cpp?rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/misc/MultipleStatementMacroCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/misc/MultipleStatementMacroCheck.cpp
> Wed Dec 14 09:29:23 2016
> @@ -26,7 +26,7 @@ const Stmt *nextStmt(const MatchFinder::
> auto Parents = Result.Context->getParents(*S);
> if (Parents.empty())
> return nullptr;
> - const Stmt *Parent = Parents[0].get<Stmt>();
> + const auto *Parent = Parents[0].get<Stmt>();
> if (!Parent)
> return nullptr;
> const Stmt *Prev = nullptr;
>
> Modified: clang-tools-extra/trunk/clang-tidy/misc/
> ThrowByValueCatchByReferenceCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/misc/ThrowByValueCatchByReferenceCh
> eck.cpp?rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
> Wed Dec 14 09:29:23 2016
> @@ -100,10 +100,8 @@ void ThrowByValueCatchByReferenceCheck::
> if (CheckAnonymousTemporaries) {
> bool emit = false;
> auto *currentSubExpr = subExpr->IgnoreImpCasts();
> - const DeclRefExpr *variableReference =
> - dyn_cast<DeclRefExpr>(currentSubExpr);
> - const CXXConstructExpr *constructorCall =
> - dyn_cast<CXXConstructExpr>(currentSubExpr);
> + const auto *variableReference = dyn_cast<DeclRefExpr>(
> currentSubExpr);
> + const auto *constructorCall = dyn_cast<CXXConstructExpr>(
> currentSubExpr);
> // If we have a DeclRefExpr, we flag for emitting a diagnosis message
> in
> // case the referenced variable is neither a function parameter nor a
> // variable declared in the catch statement.
>
> Modified: clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/modernize/UseNullptrCheck.cpp?rev=
> 289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp Wed
> Dec 14 09:29:23 2016
> @@ -26,7 +26,7 @@ const char CastSequence[] = "sequence";
>
> AST_MATCHER(Type, sugaredNullptrType) {
> const Type *DesugaredType = Node.getUnqualifiedDesugaredType();
> - if (const BuiltinType *BT = dyn_cast<BuiltinType>(DesugaredType))
> + if (const auto *BT = dyn_cast<BuiltinType>(DesugaredType))
> return BT->getKind() == BuiltinType::NullPtr;
> return false;
> }
> @@ -188,7 +188,7 @@ public:
> // Only VisitStmt is overridden as we shouldn't find other base AST
> types
> // within a cast expression.
> bool VisitStmt(Stmt *S) {
> - CastExpr *C = dyn_cast<CastExpr>(S);
> + auto *C = dyn_cast<CastExpr>(S);
> // Catch the castExpr inside cxxDefaultArgExpr.
> if (auto *E = dyn_cast<CXXDefaultArgExpr>(S))
> C = dyn_cast<CastExpr>(E->getExpr());
>
> Modified: clang-tools-extra/trunk/clang-tidy/modernize/
> UseOverrideCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/modernize/UseOverrideCheck.cpp?rev=
> 289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/modernize/UseOverrideCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/modernize/UseOverrideCheck.cpp Wed
> Dec 14 09:29:23 2016
> @@ -60,7 +60,7 @@ static StringRef GetText(const Token &To
> }
>
> void UseOverrideCheck::check(const MatchFinder::MatchResult &Result) {
> - const FunctionDecl *Method = Result.Nodes.getNodeAs<
> FunctionDecl>("method");
> + const auto *Method = Result.Nodes.getNodeAs<FunctionDecl>("method");
> const SourceManager &Sources = *Result.SourceManager;
>
> assert(Method != nullptr);
>
> Modified: clang-tools-extra/trunk/clang-tidy/mpi/TypeMismatchCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/mpi/TypeMismatchCheck.cpp?rev=289656&r1=289655&r2=289656&
> view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/mpi/TypeMismatchCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/mpi/TypeMismatchCheck.cpp Wed Dec
> 14 09:29:23 2016
> @@ -243,7 +243,7 @@ void TypeMismatchCheck::registerMatchers
>
> void TypeMismatchCheck::check(const MatchFinder::MatchResult &Result) {
> static ento::mpi::MPIFunctionClassifier FuncClassifier(*Result.
> Context);
> - const CallExpr *const CE = Result.Nodes.getNodeAs<CallExpr>("CE");
> + const auto *const CE = Result.Nodes.getNodeAs<CallExpr>("CE");
> if (!CE->getDirectCallee())
> return;
>
>
> Modified: clang-tools-extra/trunk/clang-tidy/readability/
> ImplicitBoolCastCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp?rev=
> 289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp
> Wed Dec 14 09:29:23 2016
> @@ -102,7 +102,7 @@ bool areParensNeededForOverloadedOperato
> }
>
> bool areParensNeededForStatement(const Stmt *Statement) {
> - if (const CXXOperatorCallExpr *OverloadedOperatorCall =
> + if (const auto *OverloadedOperatorCall =
> llvm::dyn_cast<CXXOperatorCallExpr>(Statement)) {
> return areParensNeededForOverloadedOperator(
> OverloadedOperatorCall->getOperator());
>
> Modified: clang-tools-extra/trunk/clang-tidy/readability/
> NamespaceCommentCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/readability/NamespaceCommentCheck.cpp?rev=
> 289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
> Wed Dec 14 09:29:23 2016
> @@ -57,7 +57,7 @@ static std::string getNamespaceComment(c
> }
>
> void NamespaceCommentCheck::check(const MatchFinder::MatchResult
> &Result) {
> - const NamespaceDecl *ND = Result.Nodes.getNodeAs<
> NamespaceDecl>("namespace");
> + const auto *ND = Result.Nodes.getNodeAs<NamespaceDecl>("namespace");
> const SourceManager &Sources = *Result.SourceManager;
>
> if (!locationsInSameFile(Sources, ND->getLocStart(),
> ND->getRBraceLoc()))
>
> Modified: clang-tools-extra/trunk/clang-tidy/readability/
> RedundantDeclarationCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp?
> rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/readability/RedundantDeclarationCheck.cpp
> Wed Dec 14 09:29:23 2016
> @@ -24,7 +24,7 @@ void RedundantDeclarationCheck::register
> }
>
> void RedundantDeclarationCheck::check(const MatchFinder::MatchResult
> &Result) {
> - const NamedDecl *D = Result.Nodes.getNodeAs<NamedDecl>("Decl");
> + const auto *D = Result.Nodes.getNodeAs<NamedDecl>("Decl");
> const auto *Prev = D->getPreviousDecl();
> if (!Prev)
> return;
>
> Modified: clang-tools-extra/trunk/clang-tidy/readability/
> RedundantSmartptrGetCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp?
> rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
> Wed Dec 14 09:29:23 2016
> @@ -116,8 +116,8 @@ void RedundantSmartptrGetCheck::check(co
>
> bool IsPtrToPtr = Result.Nodes.getNodeAs<Decl>("ptr_to_ptr") !=
> nullptr;
> bool IsMemberExpr = Result.Nodes.getNodeAs<Expr>("memberExpr") !=
> nullptr;
> - const Expr *GetCall = Result.Nodes.getNodeAs<Expr>("redundant_get");
> - const Expr *Smartptr = Result.Nodes.getNodeAs<Expr>("smart_pointer");
> + const auto *GetCall = Result.Nodes.getNodeAs<Expr>("redundant_get");
> + const auto *Smartptr = Result.Nodes.getNodeAs<Expr>("smart_pointer");
>
> if (IsPtrToPtr && IsMemberExpr) {
> // Ignore this case (eg. Foo->get()->DoSomething());
>
> Modified: clang-tools-extra/trunk/include-fixer/find-all-
> symbols/FindAllSymbols.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/include-fixer/find-all-symbols/FindAllSymbols.cpp?
> rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/include-fixer/find-all-symbols/FindAllSymbols.cpp
> (original)
> +++ clang-tools-extra/trunk/include-fixer/find-all-symbols/FindAllSymbols.cpp
> Wed Dec 14 09:29:23 2016
> @@ -211,7 +211,7 @@ void FindAllSymbols::run(const MatchFind
> return;
> }
>
> - const NamedDecl *ND = Result.Nodes.getNodeAs<NamedDecl>("decl");
> + const auto *ND = Result.Nodes.getNodeAs<NamedDecl>("decl");
> assert(ND && "Matched declaration must be a NamedDecl!");
> const SourceManager *SM = Result.SourceManager;
>
>
> Modified: clang-tools-extra/trunk/modularize/CoverageChecker.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/modularize/CoverageChecker.cpp?rev=289656&r1=289655&r2=289656&
> view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/modularize/CoverageChecker.cpp (original)
> +++ clang-tools-extra/trunk/modularize/CoverageChecker.cpp Wed Dec 14
> 09:29:23 2016
> @@ -225,9 +225,8 @@ bool CoverageChecker::collectModuleHeade
> ModuleMapHeadersSet.insert(ModularizeUtilities::getCanonicalPath(
> Header.Entry->getName()));
>
> - for (Module::submodule_const_iterator MI = Mod.submodule_begin(),
> - MIEnd = Mod.submodule_end();
> - MI != MIEnd; ++MI)
> + for (auto MI = Mod.submodule_begin(), MIEnd = Mod.submodule_end();
> + MI != MIEnd; ++MI)
> collectModuleHeaders(**MI);
>
> return true;
>
> Modified: clang-tools-extra/trunk/modularize/Modularize.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/modularize/Modularize.cpp?rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/modularize/Modularize.cpp (original)
> +++ clang-tools-extra/trunk/modularize/Modularize.cpp Wed Dec 14 09:29:23
> 2016
> @@ -341,9 +341,7 @@ static std::string findInputFile(const C
> const unsigned IncludedFlagsBitmask = options::CC1Option;
> unsigned MissingArgIndex, MissingArgCount;
> SmallVector<const char *, 256> Argv;
> - for (CommandLineArguments::const_iterator I = CLArgs.begin(),
> - E = CLArgs.end();
> - I != E; ++I)
> + for (auto I = CLArgs.begin(), E = CLArgs.end(); I != E; ++I)
> Argv.push_back(I->c_str());
> InputArgList Args = Opts->ParseArgs(Argv, MissingArgIndex,
> MissingArgCount,
> IncludedFlagsBitmask);
>
> Modified: clang-tools-extra/trunk/modularize/ModularizeUtilities.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/modularize/ModularizeUtilities.cpp?rev=289656&r1=289655&r2=289656&
> view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/modularize/ModularizeUtilities.cpp (original)
> +++ clang-tools-extra/trunk/modularize/ModularizeUtilities.cpp Wed Dec 14
> 09:29:23 2016
> @@ -77,7 +77,7 @@ ModularizeUtilities *ModularizeUtilities
> std::error_code ModularizeUtilities::loadAllHeaderListsAndDependencies()
> {
> typedef std::vector<std::string>::iterator Iter;
> // For each input file.
> - for (Iter I = InputFilePaths.begin(), E = InputFilePaths.end(); I != E;
> ++I) {
> + for (auto I = InputFilePaths.begin(), E = InputFilePaths.end(); I != E;
> ++I) {
> llvm::StringRef InputPath = *I;
> // If it's a module map.
> if (InputPath.endswith(".modulemap")) {
> @@ -345,9 +345,8 @@ bool ModularizeUtilities::collectModuleH
> DependentsVector UmbrellaDependents;
>
> // Recursively do submodules.
> - for (clang::Module::submodule_const_iterator MI =
> Mod.submodule_begin(),
> - MIEnd = Mod.submodule_end();
> - MI != MIEnd; ++MI)
> + for (auto MI = Mod.submodule_begin(), MIEnd = Mod.submodule_end();
> + MI != MIEnd; ++MI)
> collectModuleHeaders(**MI);
>
> if (const FileEntry *UmbrellaHeader = Mod.getUmbrellaHeader().Entry) {
>
> Modified: clang-tools-extra/trunk/modularize/ModuleAssistant.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/modularize/ModuleAssistant.cpp?rev=289656&r1=289655&r2=289656&
> view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/modularize/ModuleAssistant.cpp (original)
> +++ clang-tools-extra/trunk/modularize/ModuleAssistant.cpp Wed Dec 14
> 09:29:23 2016
> @@ -87,17 +87,14 @@ bool Module::output(llvm::raw_fd_ostream
> }
>
> // Output submodules.
> - for (std::vector<Module *>::iterator I = SubModules.begin(),
> - E = SubModules.end();
> - I != E; ++I) {
> + for (auto I = SubModules.begin(), E = SubModules.end(); I != E; ++I) {
> if (!(*I)->output(OS, Indent))
> return false;
> }
>
> // Output header files.
> - for (std::vector<std::string>::iterator I = HeaderFileNames.begin(),
> - E = HeaderFileNames.end();
> - I != E; ++I) {
> + for (auto I = HeaderFileNames.begin(), E = HeaderFileNames.end(); I !=
> E;
> + ++I) {
> OS.indent(Indent);
> if (IsProblem || strstr((*I).c_str(), ".inl"))
> OS << "exclude header \"" << *I << "\"\n";
> @@ -123,9 +120,7 @@ bool Module::output(llvm::raw_fd_ostream
>
> // Lookup a sub-module.
> Module *Module::findSubModule(llvm::StringRef SubName) {
> - for (std::vector<Module *>::iterator I = SubModules.begin(),
> - E = SubModules.end();
> - I != E; ++I) {
> + for (auto I = SubModules.begin(), E = SubModules.end(); I != E; ++I) {
> if ((*I)->Name == SubName)
> return *I;
> }
> @@ -227,7 +222,7 @@ static Module *loadModuleDescriptions(
> DependencyMap &Dependencies, llvm::StringRef HeaderPrefix) {
>
> // Create root module.
> - Module *RootModule = new Module(RootModuleName, false);
> + auto *RootModule = new Module(RootModuleName, false);
>
> llvm::SmallString<256> CurrentDirectory;
> llvm::sys::fs::current_path(CurrentDirectory);
>
> Modified: clang-tools-extra/trunk/modularize/PreprocessorTracker.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/modularize/PreprocessorTracker.cpp?rev=289656&r1=289655&r2=289656&
> view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/modularize/PreprocessorTracker.cpp (original)
> +++ clang-tools-extra/trunk/modularize/PreprocessorTracker.cpp Wed Dec 14
> 09:29:23 2016
> @@ -558,9 +558,7 @@ public:
> // Check for the presence of a header inclusion path handle entry.
> // Return false if not found.
> bool haveInclusionPathHandle(InclusionPathHandle H) {
> - for (std::vector<InclusionPathHandle>::iterator
> - I = InclusionPathHandles.begin(),
> - E = InclusionPathHandles.end();
> + for (auto I = InclusionPathHandles.begin(), E =
> InclusionPathHandles.end();
> I != E; ++I) {
> if (*I == H)
> return true;
> @@ -608,9 +606,8 @@ public:
> MacroExpansionInstance *
> findMacroExpansionInstance(StringHandle MacroExpanded,
> PPItemKey &DefinitionLocation) {
> - for (std::vector<MacroExpansionInstance>::iterator
> - I = MacroExpansionInstances.begin(),
> - E = MacroExpansionInstances.end();
> + for (auto I = MacroExpansionInstances.begin(),
> + E = MacroExpansionInstances.end();
> I != E; ++I) {
> if ((I->MacroExpanded == MacroExpanded) &&
> (I->DefinitionLocation == DefinitionLocation)) {
> @@ -659,9 +656,7 @@ public:
> // Check for the presence of a header inclusion path handle entry.
> // Return false if not found.
> bool haveInclusionPathHandle(InclusionPathHandle H) {
> - for (std::vector<InclusionPathHandle>::iterator
> - I = InclusionPathHandles.begin(),
> - E = InclusionPathHandles.end();
> + for (auto I = InclusionPathHandles.begin(), E =
> InclusionPathHandles.end();
> I != E; ++I) {
> if (*I == H)
> return true;
> @@ -701,9 +696,8 @@ public:
> // Find a matching condition expansion instance.
> ConditionalExpansionInstance *
> findConditionalExpansionInstance(clang::PPCallbacks::ConditionValueKind
> ConditionValue) {
> - for (std::vector<ConditionalExpansionInstance>::iterator
> - I = ConditionalExpansionInstances.begin(),
> - E = ConditionalExpansionInstances.end();
> + for (auto I = ConditionalExpansionInstances.begin(),
> + E = ConditionalExpansionInstances.end();
> I != E; ++I) {
> if (I->ConditionValue == ConditionValue) {
> return &*I; // Found.
> @@ -954,9 +948,8 @@ public:
> HeaderHandle findHeaderHandle(llvm::StringRef HeaderPath) const {
> std::string CanonicalPath = getCanonicalPath(HeaderPath);
> HeaderHandle H = 0;
> - for (std::vector<StringHandle>::const_iterator I =
> HeaderPaths.begin(),
> - E = HeaderPaths.end();
> - I != E; ++I, ++H) {
> + for (auto I = HeaderPaths.begin(), E = HeaderPaths.end(); I != E;
> + ++I, ++H) {
> if (**I == CanonicalPath)
> return H;
> }
> @@ -1004,9 +997,7 @@ public:
>
> // Check for presence of header handle in the header stack.
> bool isHeaderHandleInStack(HeaderHandle H) const {
> - for (std::vector<HeaderHandle>::const_iterator I =
> HeaderStack.begin(),
> - E = HeaderStack.end();
> - I != E; ++I) {
> + for (auto I = HeaderStack.begin(), E = HeaderStack.end(); I != E;
> ++I) {
> if (*I == H)
> return true;
> }
> @@ -1018,10 +1009,8 @@ public:
> InclusionPathHandle
> findInclusionPathHandle(const std::vector<HeaderHandle> &Path) const {
> InclusionPathHandle H = 0;
> - for (std::vector<HeaderInclusionPath>::const_iterator
> - I = InclusionPaths.begin(),
> - E = InclusionPaths.end();
> - I != E; ++I, ++H) {
> + for (auto I = InclusionPaths.begin(), E = InclusionPaths.end(); I !=
> E;
> + ++I, ++H) {
> if (I->Path == Path)
> return H;
> }
> @@ -1065,7 +1054,7 @@ public:
> StringHandle MacroName = addString(II->getName());
> PPItemKey InstanceKey(PP, MacroName, H, InstanceLoc);
> PPItemKey DefinitionKey(PP, MacroName, H, DefinitionLoc);
> - MacroExpansionMapIter I = MacroExpansions.find(InstanceKey);
> + auto I = MacroExpansions.find(InstanceKey);
> // If existing instance of expansion not found, add one.
> if (I == MacroExpansions.end()) {
> std::string InstanceSourceLine =
> @@ -1113,7 +1102,7 @@ public:
> return;
> StringHandle ConditionUnexpandedHandle(addString(ConditionUnexpanded)
> );
> PPItemKey InstanceKey(PP, ConditionUnexpandedHandle, H, InstanceLoc);
> - ConditionalExpansionMapIter I = ConditionalExpansions.find(
> InstanceKey);
> + auto I = ConditionalExpansions.find(InstanceKey);
> // If existing instance of condition not found, add one.
> if (I == ConditionalExpansions.end()) {
> std::string InstanceSourceLine =
> @@ -1144,9 +1133,8 @@ public:
> bool reportInconsistentMacros(llvm::raw_ostream &OS) override {
> bool ReturnValue = false;
> // Walk all the macro expansion trackers in the map.
> - for (MacroExpansionMapIter I = MacroExpansions.begin(),
> - E = MacroExpansions.end();
> - I != E; ++I) {
> + for (auto I = MacroExpansions.begin(), E = MacroExpansions.end(); I
> != E;
> + ++I) {
> const PPItemKey &ItemKey = I->first;
> MacroExpansionTracker &MacroExpTracker = I->second;
> // If no mismatch (only one instance value) continue.
> @@ -1162,21 +1150,19 @@ public:
> << "' has different values in this header, depending on how it
> was "
> "included.\n";
> // Walk all the instances.
> - for (std::vector<MacroExpansionInstance>::iterator
> - IMT = MacroExpTracker.MacroExpansionInstances.begin(),
> - EMT = MacroExpTracker.MacroExpansionInstances.end();
> + for (auto IMT = MacroExpTracker.MacroExpansionInstances.begin(),
> + EMT = MacroExpTracker.MacroExpansionInstances.end();
> IMT != EMT; ++IMT) {
> MacroExpansionInstance &MacroInfo = *IMT;
> OS << " '" << *MacroExpTracker.MacroUnexpanded << "' expanded
> to: '"
> << *MacroInfo.MacroExpanded
> << "' with respect to these inclusion paths:\n";
> // Walk all the inclusion path hierarchies.
> - for (std::vector<InclusionPathHandle>::iterator
> - IIP = MacroInfo.InclusionPathHandles.begin(),
> - EIP = MacroInfo.InclusionPathHandles.end();
> + for (auto IIP = MacroInfo.InclusionPathHandles.begin(),
> + EIP = MacroInfo.InclusionPathHandles.end();
> IIP != EIP; ++IIP) {
> const std::vector<HeaderHandle> &ip = getInclusionPath(*IIP);
> - int Count = (int)ip.size();
> + auto Count = (int)ip.size();
> for (int Index = 0; Index < Count; ++Index) {
> HeaderHandle H = ip[Index];
> OS << std::string((Index * 2) + 4, ' ') <<
> *getHeaderFilePath(H)
> @@ -1205,8 +1191,8 @@ public:
> bool reportInconsistentConditionals(llvm::raw_ostream &OS) override {
> bool ReturnValue = false;
> // Walk all the conditional trackers in the map.
> - for (ConditionalExpansionMapIter I = ConditionalExpansions.begin(),
> - E = ConditionalExpansions.end();
> + for (auto I = ConditionalExpansions.begin(),
> + E = ConditionalExpansions.end();
> I != E; ++I) {
> const PPItemKey &ItemKey = I->first;
> ConditionalTracker &CondTracker = I->second;
> @@ -1225,21 +1211,19 @@ public:
> << "' has different values in this header, depending on how it
> was "
> "included.\n";
> // Walk all the instances.
> - for (std::vector<ConditionalExpansionInstance>::iterator
> - IMT = CondTracker.ConditionalExpansionInstances.begin(),
> - EMT = CondTracker.ConditionalExpansionInstances.end();
> + for (auto IMT = CondTracker.ConditionalExpansionInstances.begin(),
> + EMT = CondTracker.ConditionalExpansionInstances.end();
> IMT != EMT; ++IMT) {
> ConditionalExpansionInstance &MacroInfo = *IMT;
> OS << " '" << *CondTracker.ConditionUnexpanded << "' expanded
> to: '"
> << ConditionValueKindStrings[MacroInfo.ConditionValue]
> << "' with respect to these inclusion paths:\n";
> // Walk all the inclusion path hierarchies.
> - for (std::vector<InclusionPathHandle>::iterator
> - IIP = MacroInfo.InclusionPathHandles.begin(),
> - EIP = MacroInfo.InclusionPathHandles.end();
> + for (auto IIP = MacroInfo.InclusionPathHandles.begin(),
> + EIP = MacroInfo.InclusionPathHandles.end();
> IIP != EIP; ++IIP) {
> const std::vector<HeaderHandle> &ip = getInclusionPath(*IIP);
> - int Count = (int)ip.size();
> + auto Count = (int)ip.size();
> for (int Index = 0; Index < Count; ++Index) {
> HeaderHandle H = ip[Index];
> OS << std::string((Index * 2) + 4, ' ') <<
> *getHeaderFilePath(H)
>
> Modified: clang-tools-extra/trunk/pp-trace/PPTrace.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/pp-trace/PPTrace.cpp?rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/pp-trace/PPTrace.cpp (original)
> +++ clang-tools-extra/trunk/pp-trace/PPTrace.cpp Wed Dec 14 09:29:23 2016
> @@ -161,8 +161,7 @@ static int outputPPTrace(std::vector<Cal
> const CallbackCall &Callback = *I;
> OS << "- Callback: " << Callback.Name << "\n";
>
> - for (std::vector<Argument>::const_iterator AI =
> Callback.Arguments.begin(),
> - AE =
> Callback.Arguments.end();
> + for (auto AI = Callback.Arguments.begin(), AE =
> Callback.Arguments.end();
> AI != AE; ++AI) {
> const Argument &Arg = *AI;
> OS << " " << Arg.Name << ": " << Arg.Value << "\n";
>
> Modified: clang-tools-extra/trunk/unittests/clang-tidy/
> ClangTidyDiagnosticConsumerTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTes
> t.cpp?rev=289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/unittests/clang-tidy/
> ClangTidyDiagnosticConsumerTest.cpp (original)
> +++ clang-tools-extra/trunk/unittests/clang-tidy/
> ClangTidyDiagnosticConsumerTest.cpp Wed Dec 14 09:29:23 2016
> @@ -14,7 +14,7 @@ public:
> Finder->addMatcher(ast_matchers::varDecl().bind("var"), this);
> }
> void check(const ast_matchers::MatchFinder::MatchResult &Result)
> override {
> - const VarDecl *Var = Result.Nodes.getNodeAs<VarDecl>("var");
> + const auto *Var = Result.Nodes.getNodeAs<VarDecl>("var");
> // Add diagnostics in the wrong order.
> diag(Var->getLocation(), "variable");
> diag(Var->getTypeSpecStartLoc(), "type specifier");
>
> Modified: clang-tools-extra/trunk/unittests/clang-tidy/
> NamespaceAliaserTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/unittests/clang-tidy/NamespaceAliaserTest.cpp?rev=
> 289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/unittests/clang-tidy/NamespaceAliaserTest.cpp
> (original)
> +++ clang-tools-extra/trunk/unittests/clang-tidy/NamespaceAliaserTest.cpp
> Wed Dec 14 09:29:23 2016
> @@ -31,8 +31,7 @@ public:
> if (!Aliaser)
> Aliaser.reset(new NamespaceAliaser(*Result.SourceManager));
>
> - const CallExpr *Call =
> - Result.Nodes.getNodeAs<CallExpr>("foo");
> + const auto *Call = Result.Nodes.getNodeAs<CallExpr>("foo");
> assert(Call != nullptr && "Did not find node \"foo\"");
> auto Hint = Aliaser->createAlias(*Result.Context, *Call,
> "::foo::bar",
> {"b", "some_alias"});
>
> Modified: clang-tools-extra/trunk/unittests/clang-tidy/
> UsingInserterTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/unittests/clang-tidy/UsingInserterTest.cpp?rev=
> 289656&r1=289655&r2=289656&view=diff
> ============================================================
> ==================
> --- clang-tools-extra/trunk/unittests/clang-tidy/UsingInserterTest.cpp
> (original)
> +++ clang-tools-extra/trunk/unittests/clang-tidy/UsingInserterTest.cpp
> Wed Dec 14 09:29:23 2016
> @@ -33,8 +33,7 @@ public:
> if (!Inserter)
> Inserter.reset(new UsingInserter(*Result.SourceManager));
>
> - const clang::CallExpr *Call =
> - Result.Nodes.getNodeAs<clang::CallExpr>("foo");
> + const auto *Call = Result.Nodes.getNodeAs<clang::CallExpr>("foo");
> assert(Call != nullptr && "Did not find node \"foo\"");
> auto Hint =
> Inserter->createUsingDeclaration(*Result.Context, *Call,
> "::foo::func");
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161215/2ec622da/attachment-0001.html>
More information about the cfe-commits
mailing list