Kaydet (Commit) 456f943d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix isSalCallFunction further

...after a31267be "Fix isSalCallFunction so it
also works on Windows", so that it actually does work on Windows.

Change-Id: I0218fb41b3e1000e2325967a18dfaafaa95fe415
Reviewed-on: https://gerrit.libreoffice.org/46193Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 7802b243
......@@ -206,6 +206,20 @@ inline void addPPCallbacks(
#endif
}
inline bool isPointWithin(
clang::SourceManager const & SM, clang::SourceLocation Location, clang::SourceLocation Start,
clang::SourceLocation End)
{
#if CLANG_VERSION >= 60000
return SM.isPointWithin(Location, Start, End);
#else
return
Location == Start || Location == End
|| (SM.isBeforeInTranslationUnit(Start, Location)
&& SM.isBeforeInTranslationUnit(Location, End));
#endif
}
inline bool isMacroArgExpansion(
clang::CompilerInstance& compiler, clang::SourceLocation location,
clang::SourceLocation * startLocation)
......
......@@ -117,6 +117,25 @@ class Class8_3 : public Class8_1, public Class8_2
virtual ~Class8_3();
};
#define M1(m) void m
class Class9
{
M1(method1)(); // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}}
void method2(); // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}}
};
void SAL_CALL Class9::method1() {} // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}}
#define M2(T) T SAL_CALL
M2(void) Class9::method2() {} // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}}
#if 0 // see TODO in SalCall::isSalCallFunction
class Class10
{
void method1();
};
#define M3(T, SAL_CALL) T SAL_CALL::
M3(void, Class10) method1() {} // false "SAL_CALL inconsistency"
#endif
#if 0 //TODO
template<typename> struct S {
virtual ~S();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment