[demangle] Vendor extended types shouldn't be considered substitution candidates

llvm-svn: 362983
This commit is contained in:
Erik Pilkington 2019-06-10 21:02:39 +00:00
parent 57e2da4f32
commit 65831d0499
3 changed files with 14 additions and 3 deletions

View File

@ -3576,7 +3576,11 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
StringView Res = parseBareSourceName();
if (Res.empty())
return nullptr;
return make<NameType>(Res);
// Typically, <builtin-type>s are not considered substitution candidates,
// but the exception to that exception is vendor extended types (Itanium C++
// ABI 5.9.1).
Result = make<NameType>(Res);
break;
}
case 'D':
switch (look(1)) {

View File

@ -29765,7 +29765,10 @@ const char* cases[][2] =
{"____Z3foo_block_invoke.25", "invocation function for block in foo"},
{"__Z1fv", "f()"},
{"_Z2tfIZUb_E1SEiv", "int tf<'block-literal'::S>()"}
{"_Z2tfIZUb_E1SEiv", "int tf<'block-literal'::S>()"},
// Vendor extension types are substitution candidates.
{"_Z1fu3fooS_", "f(foo, foo)"},
};
const unsigned N = sizeof(cases) / sizeof(cases[0]);

View File

@ -3576,7 +3576,11 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
StringView Res = parseBareSourceName();
if (Res.empty())
return nullptr;
return make<NameType>(Res);
// Typically, <builtin-type>s are not considered substitution candidates,
// but the exception to that exception is vendor extended types (Itanium C++
// ABI 5.9.1).
Result = make<NameType>(Res);
break;
}
case 'D':
switch (look(1)) {