Commit 90d49cba by Chris Mihelich Committed by Copybara-Service

Correctly demangle the <unresolved-name> at the end of dt and pt (x.y, x->y).

PiperOrigin-RevId: 637934582
Change-Id: Ie89b4317b11adba058dd999800e514eff49d4d69
parent ca81d343
......@@ -1956,8 +1956,10 @@ static bool ParseExpression(State *state) {
state->parse_state = copy;
// Object and pointer member access expressions.
//
// <expression> ::= (dt | pt) <expression> <unresolved-name>
if ((ParseTwoCharToken(state, "dt") || ParseTwoCharToken(state, "pt")) &&
ParseExpression(state) && ParseType(state)) {
ParseExpression(state) && ParseUnresolvedName(state)) {
return true;
}
state->parse_state = copy;
......
......@@ -407,6 +407,14 @@ TEST(Demangle, ThisPointerInDependentSignature) {
EXPECT_STREQ("S::f<>()", tmp);
}
TEST(Demangle, DependentMemberOperatorCall) {
char tmp[80];
// decltype(fp.operator()()) f<C>(C)
EXPECT_TRUE(Demangle("_Z1fI1CEDTcldtfp_onclEET_", tmp, sizeof(tmp)));
EXPECT_STREQ("f<>()", tmp);
}
// Test subobject-address template parameters.
TEST(Demangle, SubobjectAddresses) {
char tmp[80];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment