Index: clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h =================================================================== --- clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h +++ clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h @@ -1,4 +1,4 @@ -//===--- DefaultArgumentsCallsCheck.h - clang-tidy--------------------*- C++ -*-===// +//===--- DefaultArgumentsCallsCheck.h - clang-tidy --------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. Index: clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp +++ clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp @@ -21,12 +21,13 @@ void DefaultArgumentsCallsCheck::check(const MatchFinder::MatchResult &Result) { const auto *S = Result.Nodes.getNodeAs("stmt"); - if (S == nullptr) return; + if (S == nullptr) + return; diag(S->getUsedLocation(), - "calling a function that uses a default argument is disallowed"); + "calling a function that uses a default argument is disallowed"); diag(S->getParam()->getBeginLoc(), "default parameter was declared here", - DiagnosticIDs::Note); + DiagnosticIDs::Note); } } // namespace fuchsia Index: clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h =================================================================== --- clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h +++ clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h @@ -1,4 +1,4 @@ -//===--- DefaultArgumentsDeclarationsCheck.h - clang-tidy ------------------*- C++ -*-===// +//===--- DefaultArgumentsDeclarationsCheck.h - clang-tidy -------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. Index: clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp +++ clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp @@ -19,33 +19,33 @@ Finder->addMatcher(parmVarDecl(hasDefaultArgument()).bind("decl"), this); } -void DefaultArgumentsDeclarationsCheck::check(const MatchFinder::MatchResult &Result) { - const ParmVarDecl *D = Result.Nodes.getNodeAs("decl"); - if (D == nullptr) return; +void DefaultArgumentsDeclarationsCheck::check( + const MatchFinder::MatchResult &Result) { + const auto *D = Result.Nodes.getNodeAs("decl"); + if (D == nullptr) + return; SourceRange DefaultArgRange = D->getDefaultArgRange(); - if (DefaultArgRange.getEnd() != D->getEndLoc()) return; - + if (DefaultArgRange.getEnd() != D->getEndLoc()) + return; + if (DefaultArgRange.getBegin().isMacroID()) { diag(D->getBeginLoc(), - "declaring a parameter with a default argument is disallowed"); + "declaring a parameter with a default argument is disallowed"); return; } SourceLocation StartLocation = D->getName().empty() ? D->getBeginLoc() : D->getLocation(); - SourceRange RemovalRange(Lexer::getLocForEndOfToken( - StartLocation, 0, - *Result.SourceManager, - Result.Context->getLangOpts() - ), - DefaultArgRange.getEnd() - ); + SourceRange RemovalRange( + Lexer::getLocForEndOfToken(StartLocation, 0, *Result.SourceManager, + Result.Context->getLangOpts()), + DefaultArgRange.getEnd()); diag(D->getBeginLoc(), - "declaring a parameter with a default argument is disallowed") + "declaring a parameter with a default argument is disallowed") << D << FixItHint::CreateRemoval(RemovalRange); } Index: clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp =================================================================== --- clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp +++ clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp @@ -1,4 +1,4 @@ -//===--- FuchsiaTidyModule.cpp - clang-tidy--------------------------------===// +//===--- FuchsiaTidyModule.cpp - clang-tidy -------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information.