Skip to content
This repository was archived by the owner on Jun 12, 2018. It is now read-only.

Commit 8d83d9c

Browse files
committed
Fixes to last commit
1 parent ebea913 commit 8d83d9c

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/Cursor.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ std::string clang::Cursor::get_type() {
5555
if(spelling.size()>=4 && std::equal(auto_str.begin(), auto_str.end(), spelling.begin())) {
5656
auto canonical_type=clang_getCanonicalType(clang_getCursorType(cx_cursor));
5757
auto canonical_spelling=clang::to_string(clang_getTypeSpelling(canonical_type));
58-
if(spelling.size()>4 && spelling[4]==' ' &&
59-
!std::equal(auto_str.begin(), auto_str.end(), canonical_spelling.begin()))
60-
return canonical_spelling+spelling.substr(4);
58+
if(spelling.size()>5 && spelling[4]==' ' && spelling[5]=='&' && spelling!=canonical_spelling)
59+
return canonical_spelling+" &";
6160
else
6261
return canonical_spelling;
6362
}
@@ -66,9 +65,8 @@ std::string clang::Cursor::get_type() {
6665
if(spelling.size()>=10 && std::equal(const_auto_str.begin(), const_auto_str.end(), spelling.begin())) {
6766
auto canonical_type=clang_getCanonicalType(clang_getCursorType(cx_cursor));
6867
auto canonical_spelling=clang::to_string(clang_getTypeSpelling(canonical_type));
69-
if(spelling.size()>10 && spelling[10]==' ' &&
70-
!std::equal(const_auto_str.begin(), const_auto_str.end(), canonical_spelling.begin()))
71-
return canonical_spelling+spelling.substr(10);
68+
if(spelling.size()>11 && spelling[10]==' ' && spelling[11]=='&' && spelling!=canonical_spelling)
69+
return canonical_spelling+" &";
7270
else
7371
return canonical_spelling;
7472
}

0 commit comments

Comments
 (0)