[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - compilerplugins/clang

Noel Grandin noel at peralex.com
Thu Jun 30 08:18:58 UTC 2016


 compilerplugins/clang/compat.hxx |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 78879355c540237a2a73708413230001d7490065
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Jun 28 15:28:18 2016 +0200

    loplugin compat with clang 3.4
    
    Change-Id: I264fe688519b8b2173d5cccd8a453847a7fb89d9
    (cherry picked from commit 1aafc64b4d3ca2a01057209f047b136297c7842b)
    Reviewed-on: https://gerrit.libreoffice.org/26776
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index 7a87944..e1b4d8e 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -128,20 +128,35 @@ inline clang::QualType getReturnType(clang::FunctionDecl const & decl) {
 #endif
 }
 
+
 #if CLANG_VERSION >= 30900
 inline clang::ArrayRef<clang::ParmVarDecl *> parameters(
     clang::FunctionDecl const & decl)
 {
     return decl.parameters();
 }
-#else
+#elif CLANG_VERSION >= 30500
 inline clang::FunctionDecl::param_const_range parameters(
     clang::FunctionDecl const & decl)
 {
     return decl.params();
 }
+#else
+struct FunctionDeclParamsWrapper
+{
+    clang::FunctionDecl const & decl;
+    FunctionDeclParamsWrapper(clang::FunctionDecl const & _decl) : decl(_decl) {}
+    clang::FunctionDecl::param_const_iterator begin() const { return decl.param_begin(); }
+    clang::FunctionDecl::param_const_iterator end() const { return decl.param_end(); }
+};
+inline FunctionDeclParamsWrapper parameters(
+    clang::FunctionDecl const & decl)
+{
+    return FunctionDeclParamsWrapper(decl);
+}
 #endif
 
+
 inline clang::QualType getReturnType(clang::FunctionProtoType const & type) {
 #if CLANG_VERSION >= 30500
     return type.getReturnType();


More information about the Libreoffice-commits mailing list