summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/compat.hxx20
-rw-r--r--compilerplugins/clang/salbool.cxx6
2 files changed, 24 insertions, 2 deletions
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index 7389f636d0bf..5533e8f2890e 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -160,6 +160,26 @@ inline std::unique_ptr<llvm::raw_fd_ostream> create_raw_fd_ostream(
#endif
}
+inline clang::NamedDecl * const * begin(
+ clang::DeclContextLookupConstResult const & result)
+{
+#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
+ return result.begin();
+#else
+ return result.first;
+#endif
+}
+
+inline clang::NamedDecl * const * end(
+ clang::DeclContextLookupConstResult const & result)
+{
+#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
+ return result.end();
+#else
+ return result.second;
+#endif
+}
+
}
#endif
diff --git a/compilerplugins/clang/salbool.cxx b/compilerplugins/clang/salbool.cxx
index f8ae35e41957..5eddba6b5379 100644
--- a/compilerplugins/clang/salbool.cxx
+++ b/compilerplugins/clang/salbool.cxx
@@ -72,8 +72,10 @@ OverrideKind getOverrideKind(FunctionDecl const * decl) {
// encounter in practice:
bool hasBoolOverload(FunctionDecl const * decl, bool mustBeDeleted) {
unsigned n = decl->getNumParams();
- for (auto d: decl->getDeclContext()->lookup(decl->getDeclName())) {
- FunctionDecl const * f = dyn_cast<FunctionDecl>(d);
+ DeclContextLookupConstResult res
+ = decl->getDeclContext()->lookup(decl->getDeclName());
+ for (auto d = compat::begin(res); d != compat::end(res); ++d) {
+ FunctionDecl const * f = dyn_cast<FunctionDecl>(*d);
if (f != nullptr && (!mustBeDeleted || f->isDeleted())) {
if (f->getNumParams() == n) {
bool hasSB = false;
Some more loplugin:cstylecast: cppuhelperStephan Bergmann 2014-07-11new loplugin: externalandnotdefinedNoel Grandin 2014-06-05cppuhelper: remove SAL_THROW macroNoel Grandin 2014-06-04cppuhelper: fix includesThomas Arnhold 2014-05-23add default value for Context param in uno::Exception constructorsNoel Grandin 2014-03-10cppuhelper: simplify deprecated XTypeProvider.getImplementationIdStephan Bergmann 2014-02-27Remove visual noise from cppuhelperAlexander Wilms 2014-02-23Remove unneccessary commentsAlexander Wilms 2014-01-23Let C++ inline functions return bool instead of sal_BoolStephan Bergmann 2013-12-20typo fixesAndras Timar 2013-10-23remove RTL_CONSTASCII_(U)STRINGPARAMChr. Rossmanith 2013-08-19Prefer using declarations over using directivesStephan Bergmann 2012-12-06re-base on ALv2 code. Includes:Michael Meeks 2012-04-06Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operatorSzabolcs Dezsi 2012-01-26Code cleanup: ( () ) replaced by (())Alexander Bergmann 2011-11-27remove include of pch header in cppuhelperNorbert Thiebaud 2011-03-12Move OSL_ENSURE(0,...) to OSL_FAIL(...)Thomas Arnhold 2010-10-14Add vim/emacs modelines to all source filesSebastian Spaeth 2010-02-12changefileheader2: #i109125#: change source file copyright notice from Sun Mi...Jens-Heiner Rechtien 2008-04-11INTEGRATION: CWS changefileheader (1.13.88); FILE MERGEDRüdiger Timm