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:
@@ -210,13 +210,13 @@ void UnusedFields::run()
|
||||
report(
|
||||
DiagnosticsEngine::Warning,
|
||||
"read %0",
|
||||
s.parentRecord->getLocStart())
|
||||
compat::getBeginLoc(s.parentRecord))
|
||||
<< s.fieldName;
|
||||
for (const MyFieldInfo & s : writeToSet)
|
||||
report(
|
||||
DiagnosticsEngine::Warning,
|
||||
"write %0",
|
||||
s.parentRecord->getLocStart())
|
||||
compat::getBeginLoc(s.parentRecord))
|
||||
<< s.fieldName;
|
||||
}
|
||||
}
|
||||
@@ -333,8 +333,8 @@ bool UnusedFields::isSomeKindOfZero(const Expr* arg)
|
||||
// Get the expression contents.
|
||||
// This helps us find params which are always initialised with something like "OUString()".
|
||||
SourceManager& SM = compiler.getSourceManager();
|
||||
SourceLocation startLoc = arg->getLocStart();
|
||||
SourceLocation endLoc = arg->getLocEnd();
|
||||
SourceLocation startLoc = compat::getBeginLoc(arg);
|
||||
SourceLocation endLoc = compat::getEndLoc(arg);
|
||||
const char *p1 = SM.getCharacterData( startLoc );
|
||||
const char *p2 = SM.getCharacterData( endLoc );
|
||||
if (!p1 || !p2 || (p2 - p1) < 0 || (p2 - p1) > 40) {
|
||||
@@ -645,12 +645,12 @@ void UnusedFields::checkWriteOnly(const FieldDecl* fieldDecl, const Expr* member
|
||||
report(
|
||||
DiagnosticsEngine::Warning,
|
||||
"oh dear, what can the matter be?",
|
||||
memberExpr->getLocStart())
|
||||
compat::getBeginLoc(memberExpr))
|
||||
<< memberExpr->getSourceRange();
|
||||
report(
|
||||
DiagnosticsEngine::Note,
|
||||
"parent over here",
|
||||
parent->getLocStart())
|
||||
compat::getBeginLoc(parent))
|
||||
<< parent->getSourceRange();
|
||||
parent->dump();
|
||||
memberExpr->dump();
|
||||
@@ -871,7 +871,7 @@ void UnusedFields::checkReadOnly(const FieldDecl* fieldDecl, const Expr* memberE
|
||||
report(
|
||||
DiagnosticsEngine::Warning,
|
||||
"oh dear, what can the matter be? writtenTo=%0",
|
||||
memberExpr->getLocStart())
|
||||
compat::getBeginLoc(memberExpr))
|
||||
<< bPotentiallyWrittenTo
|
||||
<< memberExpr->getSourceRange();
|
||||
if (parent)
|
||||
@@ -879,7 +879,7 @@ void UnusedFields::checkReadOnly(const FieldDecl* fieldDecl, const Expr* memberE
|
||||
report(
|
||||
DiagnosticsEngine::Note,
|
||||
"parent over here",
|
||||
parent->getLocStart())
|
||||
compat::getBeginLoc(parent))
|
||||
<< parent->getSourceRange();
|
||||
parent->dump();
|
||||
}
|
||||
|
Reference in New Issue
Block a user