Browse Source

fixed has_type().

merge-requests/37/head
eidheim 11 years ago
parent
commit
352c105a81
  1. 9
      src/Token.cc

9
src/Token.cc

@ -25,7 +25,14 @@ const clang::TokenKind clang::Token::kind() {
} }
bool clang::Token::has_type() { bool clang::Token::has_type() {
return !clang_Cursor_isNull(clang_getCursorReferenced(cx_cursor)); auto referenced=clang_getCursorReferenced(cx_cursor);
if(clang_Cursor_isNull(referenced))
return false;
auto type=clang_getCursorType(referenced);
auto cxstr=clang_getTypeSpelling(type);
std::string spelling=clang_getCString(cxstr);
clang_disposeString(cxstr);
return spelling!="";
} }
std::string clang::Token::get_type() { std::string clang::Token::get_type() {

Loading…
Cancel
Save