diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-09-15 18:48:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-09-15 18:48:17 +0200 |
commit | 037a1adac9aa58022e59235db1f76605a6ddb747 (patch) | |
tree | 3cf3c69ee9aa148970784d269c72bb849fa294f3 /compilerplugins | |
parent | b7502a61aa0a6d6f54eaf73e70537c31d3ca6a36 (diff) |
Work around bug in Clang 3.2 FunctionDecl::isInlined
Change-Id: I214a9745f27c27868b3e74785cf7138fc1db1943
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/salbool.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/compilerplugins/clang/salbool.cxx b/compilerplugins/clang/salbool.cxx index 5949e75c1999..2a64fe4a5066 100644 --- a/compilerplugins/clang/salbool.cxx +++ b/compilerplugins/clang/salbool.cxx @@ -497,7 +497,18 @@ bool SalBool::VisitFunctionDecl(FunctionDecl const * decl) { || (isInUnoIncludeFile( compiler.getSourceManager().getSpellingLoc( f->getNameInfo().getLoc())) - && (!f->isInlined() || f->hasAttr<DeprecatedAttr>())))) + && ( +// Clang 3.2 FunctionDecl::isInlined doesn't work as advertised ("Determine +// whether this function should be inlined, because it is either marked 'inline' +// or 'constexpr' or is a member function of a class that was defined in the +// class body.") but mis-classifies salhelper::Timer's isTicking, isExpired, and +// expiresBefore members as defined in salhelper/source/timer.cxx as inlined: +#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3 + !f->isInlined() +#else + true +#endif + || f->hasAttr<DeprecatedAttr>())))) { SourceLocation loc { decl->getLocStart() }; SourceLocation l { compiler.getSourceManager().getExpansionLoc( |