summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/nullptr.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-08-10 12:35:21 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-08-10 15:14:03 +0200
commit3cc5149a84c7b8cfaf0deb2e2f6c88c72343ee28 (patch)
tree07bfda734ee36d2ca1dc83e2ac4a1c6ef3222691 /compilerplugins/clang/nullptr.cxx
parentd1a19ef614fd1bf115af15d3cb16e24150d4ceb7 (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/nullptr.cxx')
-rw-r--r--compilerplugins/clang/nullptr.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/compilerplugins/clang/nullptr.cxx b/compilerplugins/clang/nullptr.cxx
index ccd5837b226f..c463caec7c5d 100644
--- a/compilerplugins/clang/nullptr.cxx
+++ b/compilerplugins/clang/nullptr.cxx
@@ -121,7 +121,7 @@ bool Nullptr::VisitImplicitCastExpr(CastExpr const * expr) {
case Expr::NPCK_ZeroLiteral:
report(
DiagnosticsEngine::Warning,
- "suspicious ValueDependentIsNull %0", expr->getLocStart())
+ "suspicious ValueDependentIsNull %0", compat::getBeginLoc(expr))
<< kindName(k) << expr->getSourceRange();
break;
default:
@@ -304,7 +304,7 @@ void Nullptr::handleNull(
SourceLocation loc;
for (;;) {
e = e->IgnoreImpCasts();
- loc = e->getLocStart();
+ loc = compat::getBeginLoc(e);
while (compiler.getSourceManager().isMacroArgExpansion(loc)) {
loc = compiler.getSourceManager().getImmediateMacroCallerLoc(loc);
}
@@ -369,7 +369,7 @@ void Nullptr::rewriteOrWarn(
Expr::NullPointerConstantKind nullPointerKind, char const * replacement)
{
if (rewriter != nullptr) {
- SourceLocation locStart(expr->getLocStart());
+ SourceLocation locStart(compat::getBeginLoc(expr));
while (compiler.getSourceManager().isMacroArgExpansion(locStart)) {
locStart = compiler.getSourceManager()
.getImmediateMacroCallerLoc(locStart);
@@ -384,7 +384,7 @@ void Nullptr::rewriteOrWarn(
locStart = compat::getImmediateExpansionRange(compiler.getSourceManager(), locStart)
.first;
}
- SourceLocation locEnd(expr->getLocEnd());
+ SourceLocation locEnd(compat::getEndLoc(expr));
while (compiler.getSourceManager().isMacroArgExpansion(locEnd)) {
locEnd = compiler.getSourceManager()
.getImmediateMacroCallerLoc(locEnd);
@@ -403,13 +403,13 @@ void Nullptr::rewriteOrWarn(
}
}
if (castKind == nullptr) {
- report(DiagnosticsEngine::Warning, "%0 -> %1", expr->getLocStart())
+ report(DiagnosticsEngine::Warning, "%0 -> %1", compat::getBeginLoc(expr))
<< kindName(nullPointerKind) << replacement
<< expr->getSourceRange();
} else {
report(
DiagnosticsEngine::Warning, "%0 ValueDependentIsNotNull %1 -> %2",
- expr->getLocStart())
+ compat::getBeginLoc(expr))
<< castKind << kindName(nullPointerKind) << replacement
<< expr->getSourceRange();
}