diff options
Diffstat (limited to 'clang-tools-extra/cpp11-migrate/UseNullptr/NullptrActions.cpp')
| -rw-r--r-- | clang-tools-extra/cpp11-migrate/UseNullptr/NullptrActions.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang-tools-extra/cpp11-migrate/UseNullptr/NullptrActions.cpp b/clang-tools-extra/cpp11-migrate/UseNullptr/NullptrActions.cpp index 621862e368d..d0f2e0f0713 100644 --- a/clang-tools-extra/cpp11-migrate/UseNullptr/NullptrActions.cpp +++ b/clang-tools-extra/cpp11-migrate/UseNullptr/NullptrActions.cpp @@ -110,8 +110,10 @@ void NullptrFixer::run(const ast_matchers::MatchFinder::MatchResult &Result) { const CastExpr *Cast = Result.Nodes.getNodeAs<CastExpr>(ImplicitCastNode); if (Cast) { - SourceLocation StartLoc = Cast->getLocStart(); - SourceLocation EndLoc = Cast->getLocEnd(); + const Expr *E = Cast->IgnoreParenImpCasts(); + + SourceLocation StartLoc = E->getLocStart(); + SourceLocation EndLoc = E->getLocEnd(); // If the start/end location is a macro, get the expansion location. StartLoc = SM.getFileLoc(StartLoc); |

