Browse Source

Additional type check in Cursor::get_type_description

master
eidheim 6 years ago
parent
commit
d259a248e3
  1. 4
      src/cursor.cc

4
src/cursor.cc

@ -218,13 +218,13 @@ bool clangmm::Cursor::is_valid_kind() const {
std::string clangmm::Cursor::get_type_description() const { std::string clangmm::Cursor::get_type_description() const {
auto type = clang_getCursorType(cx_cursor); auto type = clang_getCursorType(cx_cursor);
if(type.kind != CXTypeKind::CXType_Invalid) if(type.kind != CXTypeKind::CXType_Invalid && type.kind != CXTypeKind::CXType_Unexposed)
return to_string(clang_getTypeSpelling(type)); return to_string(clang_getTypeSpelling(type));
auto referenced = clang_getCursorReferenced(cx_cursor); auto referenced = clang_getCursorReferenced(cx_cursor);
if(!clang_Cursor_isNull(referenced)) { if(!clang_Cursor_isNull(referenced)) {
auto type = clang_getCursorType(referenced); auto type = clang_getCursorType(referenced);
if(type.kind != CXTypeKind::CXType_Invalid) if(type.kind != CXTypeKind::CXType_Invalid && type.kind != CXTypeKind::CXType_Unexposed)
return to_string(clang_getTypeSpelling(type)); return to_string(clang_getTypeSpelling(type));
} }

Loading…
Cancel
Save