Properly handle upstream fix for #1

This commit is contained in:
Jonathan Müller 2019-02-01 14:24:04 +01:00
commit e2a98b3533
2 changed files with 11 additions and 3 deletions

View file

@ -182,8 +182,9 @@ private:
///
/// \returns If the database contains a configuration for the given file, returns that
/// configuration. Otherwise removes the file extension of the file and tries the same procedure for
/// common C++ header and source file extensions. \notes This function is intended to be used as the
/// basis for a `get_config` function of
/// common C++ header and source file extensions.
///
/// \notes This function is intended to be used as the basis for a `get_config` function of
/// [cppast::parse_files](standardese://cppast::parse_files_basic/).
type_safe::optional<libclang_compile_config> find_config_for(
const libclang_compilation_database& database, std::string file_name);
@ -194,6 +195,9 @@ class libclang_parser final : public parser
public:
using config = libclang_compile_config;
/// The version of libclang used.
static int libclang_minor_version();
/// \effects Creates a parser using the default logger.
libclang_parser();

View file

@ -434,6 +434,11 @@ type_safe::optional<libclang_compile_config> cppast::find_config_for(
return type_safe::nullopt;
}
int cppast::libclang_parser::libclang_minor_version()
{
return CINDEX_VERSION_MINOR;
}
struct libclang_parser::impl
{
detail::cxindex index;
@ -553,7 +558,6 @@ unsigned get_line_no(const CXCursor& cursor)
return line;
}
} // namespace
std::unique_ptr<cpp_file> libclang_parser::do_parse(const cpp_entity_index& idx, std::string path,
const compile_config& c) const try
{