[demangler] Support for inheriting constructors.

Fixes PR33223.

llvm-svn: 325023
This commit is contained in:
Erik Pilkington 2018-02-13 17:09:07 +00:00
parent aec1e58c99
commit b39094e39e
2 changed files with 9 additions and 0 deletions

View File

@ -2200,10 +2200,15 @@ Node *Db::parseCtorDtorName(Node *&SoFar) {
} }
if (consumeIf('C')) { if (consumeIf('C')) {
bool IsInherited = consumeIf('I');
if (look() != '1' && look() != '2' && look() != '3' && look() != '5') if (look() != '1' && look() != '2' && look() != '3' && look() != '5')
return nullptr; return nullptr;
++First; ++First;
ParsedCtorDtorCV = true; ParsedCtorDtorCV = true;
if (IsInherited) {
if (legacyParse<parse_name>() == nullptr)
return nullptr;
}
return make<CtorDtorName>(SoFar, false); return make<CtorDtorName>(SoFar, false);
} }

View File

@ -29690,6 +29690,10 @@ const char* cases[][2] =
// Designated init expressions // Designated init expressions
{"_ZN15designated_init1fINS_1AEEEvDTtlT_di1adi1bdxLi3EdXLi1ELi4ELi9EEE", "void designated_init::f<designated_init::A>(decltype(designated_init::A{.a.b[3][1 ... 4] = 9}))"}, {"_ZN15designated_init1fINS_1AEEEvDTtlT_di1adi1bdxLi3EdXLi1ELi4ELi9EEE", "void designated_init::f<designated_init::A>(decltype(designated_init::A{.a.b[3][1 ... 4] = 9}))"},
{"_Z1fIXtl1Xdi1adi1bdxLi3ELi1EEEE", "f<X{.a.b[3] = 1}>"}, {"_Z1fIXtl1Xdi1adi1bdxLi3ELi1EEEE", "f<X{.a.b[3] = 1}>"},
// Inheriting constructors:
{"_ZN1BCI21AEi", "B::B(int)"},
{"_ZN1DCI21CIiEET_", "D::D(int)"},
}; };
const unsigned N = sizeof(cases) / sizeof(cases[0]); const unsigned N = sizeof(cases) / sizeof(cases[0]);