llvm.org GIT mirror llvm / 815bff1
Demangle: correct demangling for CV-qualified functions When demangling a CV-qualified function type with a final reference type parameter, we would treat the reference type parameter as a r-value ref accidentally. This would result in the improper decoration of the function type itself. Resolves PR31741! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292976 91177308-0d34-0410-b5e6-96231b3b80d8 Saleem Abdulrasool 2 years ago
1 changed file(s) with 9 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
16681668 db.subs.emplace_back();
16691669 for (size_t k = k0; k < k1; ++k) {
16701670 if (is_function) {
1671 size_t p = db.names[k].second.size();
1672 if (db.names[k].second[p - 2] == '&')
1671 auto &name = db.names[k].second;
1672 size_t p = name.size();
1673
1674 if (name[p - 2] == '&' && name[p - 1] == '&')
16731675 p -= 2;
1674 else if (db.names[k].second.back() == '&')
1676 else if (name.back() == '&')
16751677 p -= 1;
1678
16761679 if (cv & CV_const) {
1677 db.names[k].second.insert(p, " const");
1680 name.insert(p, " const");
16781681 p += 6;
16791682 }
16801683 if (cv & CV_volatile) {
1681 db.names[k].second.insert(p, " volatile");
1684 name.insert(p, " volatile");
16821685 p += 9;
16831686 }
16841687 if (cv & CV_restrict)
1685 db.names[k].second.insert(p, " restrict");
1688 name.insert(p, " restrict");
16861689 } else {
16871690 if (cv & CV_const)
16881691 db.names[k].first.append(" const");