diff options
author | Gabor Horvath <xazax.hun@gmail.com> | 2016-09-24 02:13:45 +0000 |
---|---|---|
committer | Gabor Horvath <xazax.hun@gmail.com> | 2016-09-24 02:13:45 +0000 |
commit | afad84c04b4a6a7ec2d5ac56cf9022e488f875bb (patch) | |
tree | cafef3310ddba5b0c76486a67acb748b4509ec5d /clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp | |
parent | 96cbe7b9a715a3515466492b9bb9df226f2ae095 (diff) | |
download | bcm5719-llvm-afad84c04b4a6a7ec2d5ac56cf9022e488f875bb.tar.gz bcm5719-llvm-afad84c04b4a6a7ec2d5ac56cf9022e488f875bb.zip |
[clang-tidy] Cleaning up language options.
Differential Revision: https://reviews.llvm.org/D24881
llvm-svn: 282319
Diffstat (limited to 'clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp index 34353b35a18..d118db58b4f 100644 --- a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp @@ -85,9 +85,8 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) { 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 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) { 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 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) { CastText.push_back('('); diag_builder << FixItHint::CreateInsertion( Lexer::getLocForEndOfToken(SubExpr->getLocEnd(), 0, SM, - Result.Context->getLangOpts()), + getLangOpts()), ")"); } diag_builder << FixItHint::CreateReplacement(ParenRange, CastText); |