diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-05-03 21:13:35 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-05-04 13:56:51 +0200 |
commit | b72a31b37f9bdcfd3f59b3256b465bf0fb5a50ca (patch) | |
tree | 80d44735a1106b93463ae36150a3302689ffde85 /compilerplugins/clang/cppunitassertequals.cxx | |
parent | fe18111ac42101e6653402c214f7fc1df03acd43 (diff) |
Adapt to Clang trunk SourceManager::getImmediateExpansionRange changes
...of <http://llvm.org/viewvc/llvm-project?view=revision&revision=331155>
"PR37189 Fix incorrect end source location and spelling for a split '>>' token",
changing (among others) the return type of getImmediateExpansionRange from a
std::pair of token locations to CharSourceRange (which will typically also
represent token locations, but might also represent char locations).
For now, map the return value of getImmediateExpansionRange back to a std::pair
(as expected by our compilerplugins code in its current form), and mark the
char location case with a TODO (which will need to be addressed if any of our
plugins starts to produce wrong results due to not handling that char location
case). In the long run, we should instead adapt our code to use the new return
type of getImmediateExpansionRange directly.
Change-Id: Idc2f5dc43830af4798b55bf605976c4ab146c522
Reviewed-on: https://gerrit.libreoffice.org/53817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/cppunitassertequals.cxx')
-rw-r--r-- | compilerplugins/clang/cppunitassertequals.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compilerplugins/clang/cppunitassertequals.cxx b/compilerplugins/clang/cppunitassertequals.cxx index 5b0f8f5278c4..cff8908c7a46 100644 --- a/compilerplugins/clang/cppunitassertequals.cxx +++ b/compilerplugins/clang/cppunitassertequals.cxx @@ -9,6 +9,7 @@ #include "plugin.hxx" #include "check.hxx" +#include "compat.hxx" /** Check for calls to CPPUNIT_ASSERT when it should be using CPPUNIT_ASSERT_EQUALS @@ -95,7 +96,7 @@ bool CppunitAssertEquals::VisitCallExpr(const CallExpr* callExpr) << callExpr->getSourceRange(); return true; } - auto range = compiler.getSourceManager().getImmediateExpansionRange(loc); + auto range = compat::getImmediateExpansionRange(compiler.getSourceManager(), loc); checkExpr( SourceRange(range.first, range.second), name, e2->IgnoreParenImpCasts(), false); |