diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-08-10 12:35:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-08-10 15:14:03 +0200 |
commit | 3cc5149a84c7b8cfaf0deb2e2f6c88c72343ee28 (patch) | |
tree | 07bfda734ee36d2ca1dc83e2ac4a1c6ef3222691 /compilerplugins/clang/redundantcast.cxx | |
parent | d1a19ef614fd1bf115af15d3cb16e24150d4ceb7 (diff) |
Avoid -Werror=deprecated-declarations with recent Clang trunk
...which first added alternative names to and then deprecated getLocBegin/End
Change-Id: Iaefb8ce259057abfa6cd20f0b63c0ef2949a96b2
Reviewed-on: https://gerrit.libreoffice.org/58820
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/redundantcast.cxx')
-rw-r--r-- | compilerplugins/clang/redundantcast.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx index b6db47495a6d..ad7818f4a981 100644 --- a/compilerplugins/clang/redundantcast.cxx +++ b/compilerplugins/clang/redundantcast.cxx @@ -207,7 +207,7 @@ bool RedundantCast::VisitImplicitCastExpr(const ImplicitCastExpr * expr) { dyn_cast<CXXStaticCastExpr>(e)->getSubExpr() ->IgnoreParenImpCasts()->getType()) && !compiler.getSourceManager().isMacroBodyExpansion( - e->getLocStart())) + compat::getBeginLoc(e))) { report( DiagnosticsEngine::Warning, @@ -287,7 +287,7 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) { if (ignoreLocation(expr)) { return true; } - if (isInUnoIncludeFile(compiler.getSourceManager().getSpellingLoc(expr->getLocStart()))) { + if (isInUnoIncludeFile(compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(expr)))) { return true; } auto t1 = compat::getSubExprAsWritten(expr)->getType(); @@ -308,7 +308,7 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) { // Ignore FD_ISSET expanding to "...(SOCKET)(fd)..." in some Microsoft // winsock2.h (TODO: improve heuristic of determining that the whole // expr is part of a single macro body expansion): - auto l1 = expr->getLocStart(); + auto l1 = compat::getBeginLoc(expr); while (compiler.getSourceManager().isMacroArgExpansion(l1)) { l1 = compiler.getSourceManager().getImmediateMacroCallerLoc(l1); } @@ -316,7 +316,7 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) { while (compiler.getSourceManager().isMacroArgExpansion(l2)) { l2 = compiler.getSourceManager().getImmediateMacroCallerLoc(l2); } - auto l3 = expr->getLocEnd(); + auto l3 = compat::getEndLoc(expr); while (compiler.getSourceManager().isMacroArgExpansion(l3)) { l3 = compiler.getSourceManager().getImmediateMacroCallerLoc(l3); } @@ -445,7 +445,7 @@ bool RedundantCast::VisitCXXStaticCastExpr(CXXStaticCastExpr const * expr) { // h=b5889d25e9bf944a89fdd7bcabf3b6c6f6bb6f7c> "assert: Support types // without operator== (int) [BZ #21972]": if (t1->isBooleanType() && t2->isBooleanType()) { - auto loc = expr->getLocStart(); + auto loc = compat::getBeginLoc(expr); if (compiler.getSourceManager().isMacroBodyExpansion(loc) && (Lexer::getImmediateMacroName( loc, compiler.getSourceManager(), compiler.getLangOpts()) @@ -477,13 +477,13 @@ bool RedundantCast::VisitCXXReinterpretCastExpr( return true; } if (rewriter != nullptr) { - auto loc = expr->getLocStart(); + auto loc = compat::getBeginLoc(expr); while (compiler.getSourceManager().isMacroArgExpansion(loc)) { loc = compiler.getSourceManager().getImmediateMacroCallerLoc( loc); } if (compiler.getSourceManager().isMacroBodyExpansion(loc)) { - auto loc2 = expr->getLocEnd(); + auto loc2 = compat::getEndLoc(expr); while (compiler.getSourceManager().isMacroArgExpansion(loc2)) { loc2 = compiler.getSourceManager() .getImmediateMacroCallerLoc(loc2); @@ -665,8 +665,8 @@ bool RedundantCast::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr const * exp // // in sal/osl/unx/socket.cxx: //TODO: Better check that sub is exactly an expansion of FD_ISSET: - if (sub->getLocEnd().isMacroID()) { - for (auto loc = sub->getLocStart(); + if (compat::getEndLoc(sub).isMacroID()) { + for (auto loc = compat::getBeginLoc(sub); loc.isMacroID() && (compiler.getSourceManager() .isAtStartOfImmediateMacroExpansion(loc)); |