@@ -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