Skip to content

Commit 97dc4d9

Browse files
epilkliujinye-sys
authored andcommitted
[demangle] Vendor extended types shouldn't be considered substitution candidates
llvm-svn: 362983
1 parent 11587cb commit 97dc4d9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/demangle/ItaniumDemangle.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3576,7 +3576,11 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
35763576
StringView Res = parseBareSourceName();
35773577
if (Res.empty())
35783578
return nullptr;
3579-
return make<NameType>(Res);
3579+
// Typically, <builtin-type>s are not considered substitution candidates,
3580+
// but the exception to that exception is vendor extended types (Itanium C++
3581+
// ABI 5.9.1).
3582+
Result = make<NameType>(Res);
3583+
break;
35803584
}
35813585
case 'D':
35823586
switch (look(1)) {

test/test_demangle.pass.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29765,7 +29765,10 @@ const char* cases[][2] =
2976529765
{"____Z3foo_block_invoke.25", "invocation function for block in foo"},
2976629766
{"__Z1fv", "f()"},
2976729767

29768-
{"_Z2tfIZUb_E1SEiv", "int tf<'block-literal'::S>()"}
29768+
{"_Z2tfIZUb_E1SEiv", "int tf<'block-literal'::S>()"},
29769+
29770+
// Vendor extension types are substitution candidates.
29771+
{"_Z1fu3fooS_", "f(foo, foo)"},
2976929772
};
2977029773

2977129774
const unsigned N = sizeof(cases) / sizeof(cases[0]);

0 commit comments

Comments
 (0)