Better fix for 13758a3d15
"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:
@@ -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
|
||||
|
Reference in New Issue
Block a user