From 64d877b6ebf00d6c97df617612840b21afd90e87 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 20 May 2018 16:07:43 +0200 Subject: [PATCH] Only check for CXCursor_ExceptionSpecificationKind for libclang versions>=5.0.0 --- src/source_clang.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/source_clang.cc b/src/source_clang.cc index b892f81..81c5357 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -1439,10 +1439,12 @@ Source::ClangViewRefactor::ClangViewRefactor(const boost::filesystem::path &file if(clang_CXXMethod_isConst(cursor.cx_cursor)) specifier+=" const"; - + +#if CINDEX_VERSION_MAJOR>0 || (CINDEX_VERSION_MAJOR==0 && CINDEX_VERSION_MINOR>=43) auto exception_specification_kind=static_cast(clang_getCursorExceptionSpecificationType(cursor.cx_cursor)); if(exception_specification_kind==CXCursor_ExceptionSpecificationKind_BasicNoexcept) specifier+=" noexcept"; +#endif } auto name=cursor.get_spelling();