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>
This commit is contained in:
Stephan Bergmann
2018-08-10 12:35:21 +02:00
parent d1a19ef614
commit 3cc5149a84
64 changed files with 395 additions and 323 deletions

View File

@@ -76,7 +76,7 @@ bool StringConcat::VisitCallExpr(CallExpr const * expr) {
SourceLocation leftLoc;
auto const leftExpr = expr->getArg(0)->IgnoreParenImpCasts();
if (isStringLiteral(leftExpr)) {
leftLoc = leftExpr->getLocStart();
leftLoc = compat::getBeginLoc(leftExpr);
} else {
CallExpr const * left = dyn_cast<CallExpr>(leftExpr);
if (left == nullptr) {
@@ -94,11 +94,11 @@ bool StringConcat::VisitCallExpr(CallExpr const * expr) {
{
return true;
}
leftLoc = left->getArg(1)->getLocStart();
leftLoc = compat::getBeginLoc(left->getArg(1));
}
StringRef name {
getFileNameOfSpellingLoc(
compiler.getSourceManager().getSpellingLoc(expr->getLocStart())) };
compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(expr))) };
if (loplugin::isSamePathname(
name, SRCDIR "/sal/qa/rtl/strings/test_ostring_concat.cxx")
|| loplugin::isSamePathname(
@@ -112,7 +112,7 @@ bool StringConcat::VisitCallExpr(CallExpr const * expr) {
"replace '%0' between string literals with juxtaposition",
op == nullptr ? expr->getExprLoc() : op->getOperatorLoc())
<< (oo == OverloadedOperatorKind::OO_Plus ? "+" : "<<")
<< SourceRange(leftLoc, expr->getArg(1)->getLocEnd());
<< SourceRange(leftLoc, compat::getEndLoc(expr->getArg(1)));
return true;
}
@@ -124,7 +124,7 @@ bool StringConcat::isStringLiteral(Expr const * expr) {
// OSL_THIS_FUNC may be defined as "" in include/osl/diagnose.h, so don't
// warn about expressions like 'SAL_INFO(..., OSL_THIS_FUNC << ":")' or
// 'OUString(OSL_THIS_FUNC) + ":"':
auto loc = expr->getLocStart();
auto loc = compat::getBeginLoc(expr);
while (compiler.getSourceManager().isMacroArgExpansion(loc)) {
loc = compiler.getSourceManager().getImmediateMacroCallerLoc(loc);
}