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/inlinesimplememberfunctions.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/inlinesimplememberfunctions.cxx')
-rw-r--r-- | compilerplugins/clang/inlinesimplememberfunctions.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compilerplugins/clang/inlinesimplememberfunctions.cxx b/compilerplugins/clang/inlinesimplememberfunctions.cxx index 9a1d1f6f3abb..64734dc9de9a 100644 --- a/compilerplugins/clang/inlinesimplememberfunctions.cxx +++ b/compilerplugins/clang/inlinesimplememberfunctions.cxx @@ -243,8 +243,8 @@ bool InlineSimpleMemberFunctions::rewrite(const CXXMethodDecl * functionDecl) { const char *p1, *p2; // get the function body contents - p1 = compiler.getSourceManager().getCharacterData( functionDecl->getBody()->getLocStart() ); - p2 = compiler.getSourceManager().getCharacterData( functionDecl->getBody()->getLocEnd() ); + p1 = compiler.getSourceManager().getCharacterData( compat::getBeginLoc(functionDecl->getBody()) ); + p2 = compiler.getSourceManager().getCharacterData( compat::getEndLoc(functionDecl->getBody()) ); std::string s1( p1, p2 - p1 + 1); /* we can't safely move around stuff containing comments, we mess up the resulting code */ @@ -274,18 +274,18 @@ bool InlineSimpleMemberFunctions::rewrite(const CXXMethodDecl * functionDecl) { // remove the function's out of line body and declaration RewriteOptions opts; opts.RemoveLineIfEmpty = true; - if (!removeText(SourceRange(functionDecl->getLocStart(), functionDecl->getBody()->getLocEnd()), opts)) { + if (!removeText(SourceRange(compat::getBeginLoc(functionDecl), compat::getEndLoc(functionDecl->getBody())), opts)) { return false; } // scan forward until we find the semicolon const FunctionDecl * canonicalDecl = functionDecl->getCanonicalDecl(); - p1 = compiler.getSourceManager().getCharacterData( canonicalDecl->getLocEnd() ); + p1 = compiler.getSourceManager().getCharacterData( compat::getEndLoc(canonicalDecl) ); p2 = ++p1; while (*p2 != 0 && *p2 != ';') p2++; // insert the function body into the inline function definition (i.e. the one inside the class definition) - return replaceText(canonicalDecl->getLocEnd().getLocWithOffset(p2 - p1 + 1), 1, s1); + return replaceText(compat::getEndLoc(canonicalDecl).getLocWithOffset(p2 - p1 + 1), 1, s1); } loplugin::Plugin::Registration< InlineSimpleMemberFunctions > X("inlinesimplememberfunctions"); |