"SourceManager::isMacroArgExpansion has only one param in older Clang", which
caused false positives like warning about sal_False in

  CPPUNIT_ASSERT_EQUAL(guard.p->m1, sal_False);

in cppu/qa/cppumaker/test_cppumaker.cxx

Change-Id: I1c5a67527aef381e336d71cb8fefbb87961bbf96
This commit is contained in:
Stephan Bergmann
2016-04-21 12:05:48 +02:00
parent b481d42e56
commit 8d934b73cc
2 changed files with 22 additions and 4 deletions

View File

@@ -256,6 +256,24 @@ inline void addPPCallbacks(
#endif
}
inline bool isMacroArgExpansion(
clang::CompilerInstance& compiler, clang::SourceLocation location,
clang::SourceLocation * startLocation)
{
#if CLANG_VERSION >= 30900
return compiler.getSourceManager().isMacroArgExpansion(
location, startLocation);
#else
bool b = compiler.getSourceManager().isMacroArgExpansion(location);
if (b) {
startLocation* = compiler.getSourceManager()
.getSLocEntry(compiler.getSourceManager().getFileID(location))
.getExpansion().getExpansionLocStart();
}
return b;
#endif
}
inline bool isMacroBodyExpansion(clang::CompilerInstance& compiler, clang::SourceLocation location)
{
#if CLANG_VERSION >= 30300