Index: clang-tools-extra/trunk/clang-tidy/cert/StrToNumCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/cert/StrToNumCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/cert/StrToNumCheck.cpp @@ -214,7 +214,7 @@ // Formatted input functions need further checking of the format string to // determine whether a problematic conversion may be happening. - Conversion = ClassifyFormatString(FmtStr, Result.Context->getLangOpts(), + Conversion = ClassifyFormatString(FmtStr, getLangOpts(), Result.Context->getTargetInfo()); if (Conversion != ConversionKind::None) FuncDecl = FFD; Index: clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp @@ -68,7 +68,7 @@ CharSourceRange::getTokenRange( MatchedCast->getLParenLoc().getLocWithOffset(1), MatchedCast->getRParenLoc().getLocWithOffset(-1)), - *Result.SourceManager, Result.Context->getLangOpts()); + *Result.SourceManager, getLangOpts()); auto diag_builder = diag( MatchedCast->getLocStart(), @@ -82,8 +82,7 @@ CastText.push_back('('); diag_builder << FixItHint::CreateInsertion( Lexer::getLocForEndOfToken(SubExpr->getLocEnd(), 0, - *Result.SourceManager, - Result.Context->getLangOpts()), + *Result.SourceManager, getLangOpts()), ")"); } auto ParenRange = CharSourceRange::getTokenRange( Index: clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.cpp @@ -85,9 +85,8 @@ return; } - // The rest of this check is only relevant to C++. - if (!Result.Context->getLangOpts().CPlusPlus) + if (!getLangOpts().CPlusPlus) return; // Ignore code inside extern "C" {} blocks. if (!match(expr(hasAncestor(linkageSpecDecl())), *CastExpr, *Result.Context) @@ -109,7 +108,7 @@ Lexer::getSourceText(CharSourceRange::getTokenRange( CastExpr->getLParenLoc().getLocWithOffset(1), CastExpr->getRParenLoc().getLocWithOffset(-1)), - SM, Result.Context->getLangOpts()); + SM, getLangOpts()); auto diag_builder = diag(CastExpr->getLocStart(), "C-style casts are discouraged; use %0"); @@ -123,7 +122,7 @@ CastText.push_back('('); diag_builder << FixItHint::CreateInsertion( Lexer::getLocForEndOfToken(SubExpr->getLocEnd(), 0, SM, - Result.Context->getLangOpts()), + getLangOpts()), ")"); } diag_builder << FixItHint::CreateReplacement(ParenRange, CastText); Index: clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.cpp @@ -92,7 +92,7 @@ Tok.getRawIdentifier() == "explicit"; }; SourceRange ExplicitTokenRange = - FindToken(*Result.SourceManager, Result.Context->getLangOpts(), + FindToken(*Result.SourceManager, getLangOpts(), Ctor->getOuterLocStart(), Ctor->getLocEnd(), isKWExplicit); StringRef ConstructorDescription; if (Ctor->isMoveConstructor()) Index: clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.cpp @@ -45,8 +45,7 @@ if (VD->getType()->getCanonicalTypeUnqualified() == C->getType()->getCanonicalTypeUnqualified()) { SourceLocation EndLoc = Lexer::getLocForEndOfToken( - VD->getInit()->getLocEnd(), 0, *Result.SourceManager, - Result.Context->getLangOpts()); + VD->getInit()->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); Diag << FixItHint::CreateReplacement(TypeRange, "std::string") << FixItHint::CreateInsertion(VD->getInit()->getLocStart(), "(") << FixItHint::CreateInsertion(EndLoc, ").str()"); Index: clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.cpp @@ -101,7 +101,7 @@ void AssertSideEffectCheck::check(const MatchFinder::MatchResult &Result) { const SourceManager &SM = *Result.SourceManager; - const LangOptions LangOpts = Result.Context->getLangOpts(); + const LangOptions LangOpts = getLangOpts(); SourceLocation Loc = Result.Nodes.getNodeAs("condStmt")->getLocStart(); StringRef AssertMacroName; Index: clang-tools-extra/trunk/clang-tidy/misc/InaccurateEraseCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/InaccurateEraseCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/InaccurateEraseCheck.cpp @@ -57,10 +57,9 @@ const auto *AlgCall = Result.Nodes.getNodeAs("InaccAlgCall"); std::string ReplacementText = Lexer::getSourceText( CharSourceRange::getTokenRange(EndExpr->getSourceRange()), - *Result.SourceManager, Result.Context->getLangOpts()); + *Result.SourceManager, getLangOpts()); const SourceLocation EndLoc = Lexer::getLocForEndOfToken( - AlgCall->getLocEnd(), 0, *Result.SourceManager, - Result.Context->getLangOpts()); + AlgCall->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); Hint = FixItHint::CreateInsertion(EndLoc, ", " + ReplacementText); } Index: clang-tools-extra/trunk/clang-tidy/misc/InefficientAlgorithmCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/InefficientAlgorithmCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/InefficientAlgorithmCheck.cpp @@ -117,7 +117,7 @@ FixItHint Hint; SourceManager &SM = *Result.SourceManager; - LangOptions LangOpts = Result.Context->getLangOpts(); + LangOptions LangOpts = getLangOpts(); CharSourceRange CallRange = CharSourceRange::getTokenRange(AlgCall->getSourceRange()); Index: clang-tools-extra/trunk/clang-tidy/misc/StringIntegerAssignmentCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/StringIntegerAssignmentCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/StringIntegerAssignmentCheck.cpp @@ -62,8 +62,7 @@ } SourceLocation EndLoc = Lexer::getLocForEndOfToken( - Argument->getLocEnd(), 0, *Result.SourceManager, - Result.Context->getLangOpts()); + Argument->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); if (IsOneDigit) { Diag << FixItHint::CreateInsertion(Loc, IsWideCharType ? "L'" : "'") << FixItHint::CreateInsertion(EndLoc, "'"); Index: clang-tools-extra/trunk/clang-tidy/misc/SuspiciousStringCompareCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/SuspiciousStringCompareCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/SuspiciousStringCompareCheck.cpp @@ -177,7 +177,7 @@ if (Result.Nodes.getNodeAs("missing-comparison")) { SourceLocation EndLoc = Lexer::getLocForEndOfToken( Call->getRParenLoc(), 0, Result.Context->getSourceManager(), - Result.Context->getLangOpts()); + getLangOpts()); diag(Call->getLocStart(), "function %0 is called without explicitly comparing result") @@ -187,7 +187,7 @@ if (const auto *E = Result.Nodes.getNodeAs("logical-not-comparison")) { SourceLocation EndLoc = Lexer::getLocForEndOfToken( Call->getRParenLoc(), 0, Result.Context->getSourceManager(), - Result.Context->getLangOpts()); + getLangOpts()); SourceLocation NotLoc = E->getLocStart(); diag(Call->getLocStart(), Index: clang-tools-extra/trunk/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp @@ -107,10 +107,10 @@ std::string LeftText = clang::Lexer::getSourceText( CharSourceRange::getTokenRange(Left->getSourceRange()), - *Result.SourceManager, Result.Context->getLangOpts()); + *Result.SourceManager, getLangOpts()); std::string RightText = clang::Lexer::getSourceText( CharSourceRange::getTokenRange(Right->getSourceRange()), - *Result.SourceManager, Result.Context->getLangOpts()); + *Result.SourceManager, getLangOpts()); if (ResetMember->isArrow()) LeftText = "*" + LeftText; Index: clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.cpp @@ -37,7 +37,7 @@ AliasDecl->getLocStart(), Lexer::findLocationAfterToken( AliasDecl->getLocEnd(), tok::semi, *Result.SourceManager, - Result.Context->getLangOpts(), + getLangOpts(), /*SkipTrailingWhitespaceAndNewLine=*/true)); return; } Index: clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.cpp @@ -85,7 +85,7 @@ const auto *TL = selectFirst("t", Matches); D << FixItHint::CreateInsertion( Lexer::getLocForEndOfToken(TL->getLocEnd(), 0, *Result.SourceManager, - Result.Context->getLangOpts()), + getLangOpts()), Replacement); } Index: clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp @@ -64,8 +64,7 @@ Context.UsingDeclRange = CharSourceRange::getCharRange( Using->getLocStart(), Lexer::findLocationAfterToken( - Using->getLocEnd(), tok::semi, *Result.SourceManager, - Result.Context->getLangOpts(), + Using->getLocEnd(), tok::semi, *Result.SourceManager, getLangOpts(), /*SkipTrailingWhitespaceAndNewLine=*/true)); for (const auto *UsingShadow : Using->shadows()) { const auto *TargetDecl = UsingShadow->getTargetDecl()->getCanonicalDecl(); Index: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp @@ -200,11 +200,10 @@ TypeLoc ValueTL = RefTL.getPointeeLoc(); auto TypeRange = CharSourceRange::getTokenRange(ParmDecl->getLocStart(), ParamTL.getLocEnd()); - std::string ValueStr = - Lexer::getSourceText( - CharSourceRange::getTokenRange(ValueTL.getSourceRange()), SM, - Result.Context->getLangOpts()) - .str(); + std::string ValueStr = Lexer::getSourceText(CharSourceRange::getTokenRange( + ValueTL.getSourceRange()), + SM, getLangOpts()) + .str(); ValueStr += ' '; Diag << FixItHint::CreateReplacement(TypeRange, ValueStr); } Index: clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp @@ -108,15 +108,15 @@ } void RawStringLiteralCheck::registerMatchers(MatchFinder *Finder) { + // Raw string literals require C++11 or later. + if (!getLangOpts().CPlusPlus11) + return; + Finder->addMatcher( stringLiteral(unless(hasParent(predefinedExpr()))).bind("lit"), this); } void RawStringLiteralCheck::check(const MatchFinder::MatchResult &Result) { - // Raw string literals require C++11 or later. - if (!Result.Context->getLangOpts().CPlusPlus11) - return; - const auto *Literal = Result.Nodes.getNodeAs("lit"); if (Literal->getLocStart().isMacroID()) return; @@ -129,7 +129,7 @@ const MatchFinder::MatchResult &Result, const StringLiteral *Literal) { CharSourceRange CharRange = Lexer::makeFileCharRange( CharSourceRange::getTokenRange(Literal->getSourceRange()), - *Result.SourceManager, Result.Context->getLangOpts()); + *Result.SourceManager, getLangOpts()); diag(Literal->getLocStart(), "escaped string literal can be written as a raw string literal") << FixItHint::CreateReplacement( Index: clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp @@ -45,6 +45,9 @@ } // namespace void RedundantVoidArgCheck::registerMatchers(MatchFinder *Finder) { + if (!getLangOpts().CPlusPlus) + return; + Finder->addMatcher(functionDecl(parameterCountIs(0), unless(isImplicit()), unless(isExternC())) .bind(FunctionId), @@ -72,10 +75,6 @@ } void RedundantVoidArgCheck::check(const MatchFinder::MatchResult &Result) { - if (!Result.Context->getLangOpts().CPlusPlus) { - return; - } - const BoundNodes &Nodes = Result.Nodes; if (const auto *Function = Nodes.getNodeAs(FunctionId)) { processFunctionDecl(Result, Function); @@ -118,16 +117,15 @@ void RedundantVoidArgCheck::removeVoidArgumentTokens( const ast_matchers::MatchFinder::MatchResult &Result, SourceRange Range, StringRef GrammarLocation) { - CharSourceRange CharRange = Lexer::makeFileCharRange( - CharSourceRange::getTokenRange(Range), *Result.SourceManager, - Result.Context->getLangOpts()); - - std::string DeclText = Lexer::getSourceText(CharRange, *Result.SourceManager, - Result.Context->getLangOpts()) - .str(); - Lexer PrototypeLexer(CharRange.getBegin(), Result.Context->getLangOpts(), - DeclText.data(), DeclText.data(), - DeclText.data() + DeclText.size()); + CharSourceRange CharRange = + Lexer::makeFileCharRange(CharSourceRange::getTokenRange(Range), + *Result.SourceManager, getLangOpts()); + + std::string DeclText = + Lexer::getSourceText(CharRange, *Result.SourceManager, getLangOpts()) + .str(); + Lexer PrototypeLexer(CharRange.getBegin(), getLangOpts(), DeclText.data(), + DeclText.data(), DeclText.data() + DeclText.size()); enum TokenState { NothingYet, SawLeftParen, Index: clang-tools-extra/trunk/clang-tidy/modernize/ShrinkToFitCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/ShrinkToFitCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/ShrinkToFitCheck.cpp @@ -20,6 +20,9 @@ namespace modernize { void ShrinkToFitCheck::registerMatchers(MatchFinder *Finder) { + if (!getLangOpts().CPlusPlus11) + return; + // Swap as a function need not to be considered, because rvalue can not // be bound to a non-const reference. const auto ShrinkableAsMember = @@ -51,17 +54,13 @@ } void ShrinkToFitCheck::check(const MatchFinder::MatchResult &Result) { - const LangOptions &Opts = Result.Context->getLangOpts(); - - if (!Opts.CPlusPlus11) - return; - const auto *MemberCall = Result.Nodes.getNodeAs("CopyAndSwapTrick"); const auto *Container = Result.Nodes.getNodeAs("ContainerToShrink"); FixItHint Hint; if (!MemberCall->getLocStart().isMacroID()) { + const LangOptions &Opts = getLangOpts(); std::string ReplacementText; if (const auto *UnaryOp = llvm::dyn_cast(Container)) { ReplacementText = Index: clang-tools-extra/trunk/clang-tidy/modernize/UseOverrideCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/UseOverrideCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/modernize/UseOverrideCheck.cpp @@ -104,7 +104,7 @@ CharSourceRange FileRange = Lexer::makeFileCharRange( CharSourceRange::getTokenRange(Method->getSourceRange()), Sources, - Result.Context->getLangOpts()); + getLangOpts()); if (!FileRange.isValid()) return; Index: clang-tools-extra/trunk/clang-tidy/mpi/TypeMismatchCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/mpi/TypeMismatchCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/mpi/TypeMismatchCheck.cpp @@ -296,8 +296,7 @@ addPair(0, 2); } } - checkArguments(BufferTypes, BufferExprs, MPIDatatypes, - Result.Context->getLangOpts()); + checkArguments(BufferTypes, BufferExprs, MPIDatatypes, getLangOpts()); } void TypeMismatchCheck::checkArguments(ArrayRef BufferTypes, Index: clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/AvoidConstParamsInDecls.cpp @@ -100,7 +100,7 @@ CharSourceRange FileRange = Lexer::makeFileCharRange( CharSourceRange::getTokenRange(getTypeRange(*Param)), - *Result.SourceManager, Result.Context->getLangOpts()); + *Result.SourceManager, getLangOpts()); if (!FileRange.isValid()) return; Index: clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.cpp @@ -69,9 +69,9 @@ const auto *BinaryOp = Result.Nodes.getNodeAs("SizeBinaryOp"); const auto *E = Result.Nodes.getNodeAs("STLObject"); FixItHint Hint; - std::string ReplacementText = Lexer::getSourceText( - CharSourceRange::getTokenRange(E->getSourceRange()), - *Result.SourceManager, Result.Context->getLangOpts()); + std::string ReplacementText = + Lexer::getSourceText(CharSourceRange::getTokenRange(E->getSourceRange()), + *Result.SourceManager, getLangOpts()); if (E->getType()->isPointerType()) ReplacementText += "->empty()"; else Index: clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp @@ -75,7 +75,7 @@ SourceLocation Loc = AfterRBrace; Token Tok; // Skip whitespace until we find the next token. - while (Lexer::getRawToken(Loc, Tok, Sources, Result.Context->getLangOpts()) || + while (Lexer::getRawToken(Loc, Tok, Sources, getLangOpts()) || Tok.is(tok::semi)) { Loc = Loc.getLocWithOffset(1); } Index: clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/RedundantControlFlowCheck.cpp @@ -80,16 +80,14 @@ SourceLocation Start; if (Previous != Block->body_rend()) Start = Lexer::findLocationAfterToken( - dyn_cast(*Previous)->getLocEnd(), tok::semi, SM, - Result.Context->getLangOpts(), + dyn_cast(*Previous)->getLocEnd(), tok::semi, SM, getLangOpts(), /*SkipTrailingWhitespaceAndNewLine=*/true); if (!Start.isValid()) Start = StmtRange.getBegin(); auto RemovedRange = CharSourceRange::getCharRange( - Start, - Lexer::findLocationAfterToken(StmtRange.getEnd(), tok::semi, SM, - Result.Context->getLangOpts(), - /*SkipTrailingWhitespaceAndNewLine=*/true)); + Start, Lexer::findLocationAfterToken( + StmtRange.getEnd(), tok::semi, SM, getLangOpts(), + /*SkipTrailingWhitespaceAndNewLine=*/true)); diag(StmtRange.getBegin(), Diag) << FixItHint::CreateRemoval(RemovedRange); } Index: clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.cpp @@ -119,7 +119,7 @@ StringRef SmartptrText = Lexer::getSourceText( CharSourceRange::getTokenRange(Smartptr->getSourceRange()), - *Result.SourceManager, Result.Context->getLangOpts()); + *Result.SourceManager, getLangOpts()); // Replace foo->get() with *foo, and foo.get() with foo. std::string Replacement = Twine(IsPtrToPtr ? "*" : "", SmartptrText).str(); diag(GetCall->getLocStart(), "redundant get() call on smart pointer") Index: clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp @@ -559,9 +559,9 @@ const ast_matchers::MatchFinder::MatchResult &Result, SourceLocation Loc, StringRef Description, SourceRange ReplacementRange, StringRef Replacement) { - CharSourceRange CharRange = Lexer::makeFileCharRange( - CharSourceRange::getTokenRange(ReplacementRange), *Result.SourceManager, - Result.Context->getLangOpts()); + CharSourceRange CharRange = + Lexer::makeFileCharRange(CharSourceRange::getTokenRange(ReplacementRange), + *Result.SourceManager, getLangOpts()); DiagnosticBuilder Diag = diag(Loc, Description); if (!containsDiscardedTokens(Result, CharRange)) Index: clang-tools-extra/trunk/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.cpp @@ -53,12 +53,12 @@ Token Tok; SourceLocation Loc = Def->getSourceRange().getBegin(); while (Loc < Def->getSourceRange().getEnd() && - !Lexer::getRawToken(Loc, Tok, *Result.SourceManager, - Result.Context->getLangOpts(), true)) { + !Lexer::getRawToken(Loc, Tok, *Result.SourceManager, getLangOpts(), + true)) { SourceRange TokenRange(Tok.getLocation(), Tok.getEndLoc()); - StringRef SourceText = Lexer::getSourceText( - CharSourceRange::getTokenRange(TokenRange), - *Result.SourceManager, Result.Context->getLangOpts()); + StringRef SourceText = + Lexer::getSourceText(CharSourceRange::getTokenRange(TokenRange), + *Result.SourceManager, getLangOpts()); if (SourceText == "static") { Diag << FixItHint::CreateRemoval(TokenRange); break; Index: clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp @@ -51,9 +51,8 @@ if (PtrExpr->getType()->isDependentType()) return; - SourceLocation AfterPtr = - Lexer::getLocForEndOfToken(PtrExpr->getLocEnd(), 0, *Result.SourceManager, - Result.Context->getLangOpts()); + SourceLocation AfterPtr = Lexer::getLocForEndOfToken( + PtrExpr->getLocEnd(), 0, *Result.SourceManager, getLangOpts()); diag(DeleteExpr->getLocStart(), "prefer '= nullptr' to 'delete x.release()' to reset unique_ptr<> "