Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
[demangle] Vendor extended types shouldn't be considered substitution…
Browse files Browse the repository at this point in the history
… candidates

git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@362983 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
epilk committed Jun 10, 2019
1 parent c0565cd commit 931ee9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/demangle/ItaniumDemangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
5 changes: 4 additions & 1 deletion test/test_demangle.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 931ee9e

Please sign in to comment.