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/fragiledestructor.cxx | |
parent | tdf#42949 Fix IWYU warnings in include/salhelper/* (diff) | |
download | core-3cc5149a84c7b8cfaf0deb2e2f6c88c72343ee28.tar.gz core-3cc5149a84c7b8cfaf0deb2e2f6c88c72343ee28.zip |
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/fragiledestructor.cxx')
-rw-r--r-- | compilerplugins/clang/fragiledestructor.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compilerplugins/clang/fragiledestructor.cxx b/compilerplugins/clang/fragiledestructor.cxx index d1bff95ddf72..2c4b3235eb38 100644 --- a/compilerplugins/clang/fragiledestructor.cxx +++ b/compilerplugins/clang/fragiledestructor.cxx @@ -48,7 +48,7 @@ bool FragileDestructor::TraverseCXXDestructorDecl(CXXDestructorDecl* pCXXDestruc } // ignore this for now, too tricky for me to work out StringRef aFileName = getFileNameOfSpellingLoc( - compiler.getSourceManager().getSpellingLoc(pCXXDestructorDecl->getLocStart())); + compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(pCXXDestructorDecl))); if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/comphelper/") || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/cppuhelper/") || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/cppuhelper/") @@ -80,15 +80,15 @@ bool FragileDestructor::VisitCXXMemberCallExpr(const CXXMemberCallExpr* callExpr return true; } // if we see an explicit call to its own method, that's OK - auto s1 = compiler.getSourceManager().getCharacterData(callExpr->getLocStart()); - auto s2 = compiler.getSourceManager().getCharacterData(callExpr->getLocEnd()); + auto s1 = compiler.getSourceManager().getCharacterData(compat::getBeginLoc(callExpr)); + auto s2 = compiler.getSourceManager().getCharacterData(compat::getEndLoc(callExpr)); std::string tok(s1, s2-s1); if (tok.find("::") != std::string::npos) { return true; } // e.g. osl/thread.hxx and cppuhelper/compbase.hxx StringRef aFileName = getFileNameOfSpellingLoc( - compiler.getSourceManager().getSpellingLoc(methodDecl->getLocStart())); + compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(methodDecl))); if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/osl/") || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/comphelper/") || loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/cppuhelper/")) @@ -96,12 +96,12 @@ bool FragileDestructor::VisitCXXMemberCallExpr(const CXXMemberCallExpr* callExpr report( DiagnosticsEngine::Warning, "calling virtual method from destructor, either make the virtual method SAL_FINAL, or make this class SAL_FINAL", - callExpr->getLocStart()) + compat::getBeginLoc(callExpr)) << callExpr->getSourceRange(); report( DiagnosticsEngine::Note, "callee method here", - methodDecl->getLocStart()) + compat::getBeginLoc(methodDecl)) << methodDecl->getSourceRange(); return true; } |