diff --git a/src/cursor.cc b/src/cursor.cc index c8ccd98..95b60b9 100644 --- a/src/cursor.cc +++ b/src/cursor.cc @@ -10,6 +10,10 @@ clangmm::Cursor::Type clangmm::Cursor::Type::get_result() const { return Type(clang_getResultType(cx_type)); } +clangmm::Cursor clangmm::Cursor::Type::get_cursor() const { + return Cursor(clang_getTypeDeclaration(cx_type)); +} + bool clangmm::Cursor::Type::operator==(const Cursor::Type& rhs) const { return clang_equalTypes(cx_type, rhs.cx_type); } diff --git a/src/cursor.h b/src/cursor.h index bdb229d..6d6cf2e 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -182,6 +182,7 @@ namespace clangmm { Type(const CXType &cx_type) : cx_type(cx_type) {} std::string get_spelling() const; Type get_result() const; + Cursor get_cursor() const; bool operator==(const Cursor::Type& rhs) const; CXType cx_type;