summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/expressionalwayszero.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/expressionalwayszero.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/expressionalwayszero.cxx')
-rw-r--r--compilerplugins/clang/expressionalwayszero.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/compilerplugins/clang/expressionalwayszero.cxx b/compilerplugins/clang/expressionalwayszero.cxx
index 0f0eb7a541e6..ab343c1ae902 100644
--- a/compilerplugins/clang/expressionalwayszero.cxx
+++ b/compilerplugins/clang/expressionalwayszero.cxx
@@ -73,7 +73,7 @@ bool ExpressionAlwaysZero::VisitBinaryOperator( BinaryOperator const * binaryOpe
{
if (ignoreLocation(binaryOperator))
return true;
- if (binaryOperator->getLocStart().isMacroID())
+ if (compat::getBeginLoc(binaryOperator).isMacroID())
return true;
auto op = binaryOperator->getOpcode();
@@ -92,7 +92,7 @@ bool ExpressionAlwaysZero::VisitBinaryOperator( BinaryOperator const * binaryOpe
return true;
report(
DiagnosticsEngine::Warning, "expression always evaluates to zero, lhs=%0 rhs=%1",
- binaryOperator->getLocStart())
+ compat::getBeginLoc(binaryOperator))
<< (lhsValue ? lhsValue->toString(10) : "unknown")
<< (rhsValue ? rhsValue->toString(10) : "unknown")
<< binaryOperator->getSourceRange();
@@ -103,7 +103,7 @@ bool ExpressionAlwaysZero::VisitCXXOperatorCallExpr( CXXOperatorCallExpr const *
{
if (ignoreLocation(cxxOperatorCallExpr))
return true;
- if (cxxOperatorCallExpr->getLocStart().isMacroID())
+ if (compat::getBeginLoc(cxxOperatorCallExpr).isMacroID())
return true;
auto op = cxxOperatorCallExpr->getOperator();
@@ -124,7 +124,7 @@ bool ExpressionAlwaysZero::VisitCXXOperatorCallExpr( CXXOperatorCallExpr const *
return true;
report(
DiagnosticsEngine::Warning, "expression always evaluates to zero, lhs=%0 rhs=%1",
- cxxOperatorCallExpr->getLocStart())
+ compat::getBeginLoc(cxxOperatorCallExpr))
<< (lhsValue ? lhsValue->toString(10) : "unknown")
<< (rhsValue ? rhsValue->toString(10) : "unknown")
<< cxxOperatorCallExpr->getSourceRange();