Browse Source

Fixes to last commit

merge-requests/37/head
eidheim 10 years ago
parent
commit
8d83d9c69b
  1. 10
      src/Cursor.cc

10
src/Cursor.cc

@ -55,9 +55,8 @@ std::string clang::Cursor::get_type() {
if(spelling.size()>=4 && std::equal(auto_str.begin(), auto_str.end(), spelling.begin())) { if(spelling.size()>=4 && std::equal(auto_str.begin(), auto_str.end(), spelling.begin())) {
auto canonical_type=clang_getCanonicalType(clang_getCursorType(cx_cursor)); auto canonical_type=clang_getCanonicalType(clang_getCursorType(cx_cursor));
auto canonical_spelling=clang::to_string(clang_getTypeSpelling(canonical_type)); auto canonical_spelling=clang::to_string(clang_getTypeSpelling(canonical_type));
if(spelling.size()>4 && spelling[4]==' ' && if(spelling.size()>5 && spelling[4]==' ' && spelling[5]=='&' && spelling!=canonical_spelling)
!std::equal(auto_str.begin(), auto_str.end(), canonical_spelling.begin())) return canonical_spelling+" &";
return canonical_spelling+spelling.substr(4);
else else
return canonical_spelling; return canonical_spelling;
} }
@ -66,9 +65,8 @@ std::string clang::Cursor::get_type() {
if(spelling.size()>=10 && std::equal(const_auto_str.begin(), const_auto_str.end(), spelling.begin())) { if(spelling.size()>=10 && std::equal(const_auto_str.begin(), const_auto_str.end(), spelling.begin())) {
auto canonical_type=clang_getCanonicalType(clang_getCursorType(cx_cursor)); auto canonical_type=clang_getCanonicalType(clang_getCursorType(cx_cursor));
auto canonical_spelling=clang::to_string(clang_getTypeSpelling(canonical_type)); auto canonical_spelling=clang::to_string(clang_getTypeSpelling(canonical_type));
if(spelling.size()>10 && spelling[10]==' ' && if(spelling.size()>11 && spelling[10]==' ' && spelling[11]=='&' && spelling!=canonical_spelling)
!std::equal(const_auto_str.begin(), const_auto_str.end(), canonical_spelling.begin())) return canonical_spelling+" &";
return canonical_spelling+spelling.substr(10);
else else
return canonical_spelling; return canonical_spelling;
} }

Loading…
Cancel
Save