Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[ItaniumDemangle] Add Named flag to "pm" operator #136862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! restore condition; mark "pm" as Named
  • Loading branch information
Michael137 committed Apr 25, 2025
commit c545ebd60097f92a426984a1870cb5e24fafaafd
15 changes: 11 additions & 4 deletions 15 libcxxabi/src/demangle/ItaniumDemangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -3389,8 +3389,10 @@ const typename AbstractManglingParser<
{"de", OperatorInfo::Prefix, false, Node::Prec::Unary, "operator*"},
{"dl", OperatorInfo::Del, /*Ary*/ false, Node::Prec::Unary,
"operator delete"},
{"ds", OperatorInfo::Member, false, Node::Prec::PtrMem, "operator.*"},
{"dt", OperatorInfo::Member, false, Node::Prec::Postfix, "operator."},
{"ds", OperatorInfo::Member, /*Named*/ false, Node::Prec::PtrMem,
"operator.*"},
{"dt", OperatorInfo::Member, /*Named*/ false, Node::Prec::Postfix,
"operator."},
{"dv", OperatorInfo::Binary, false, Node::Prec::Assign, "operator/"},
{"eO", OperatorInfo::Binary, false, Node::Prec::Assign, "operator^="},
{"eo", OperatorInfo::Binary, false, Node::Prec::Xor, "operator^"},
Expand Down Expand Up @@ -3419,10 +3421,12 @@ const typename AbstractManglingParser<
{"or", OperatorInfo::Binary, false, Node::Prec::Ior, "operator|"},
{"pL", OperatorInfo::Binary, false, Node::Prec::Assign, "operator+="},
{"pl", OperatorInfo::Binary, false, Node::Prec::Additive, "operator+"},
{"pm", OperatorInfo::Member, false, Node::Prec::PtrMem, "operator->*"},
{"pm", OperatorInfo::Member, /*Named*/ true, Node::Prec::PtrMem,
"operator->*"},
{"pp", OperatorInfo::Postfix, false, Node::Prec::Postfix, "operator++"},
{"ps", OperatorInfo::Prefix, false, Node::Prec::Unary, "operator+"},
{"pt", OperatorInfo::Member, false, Node::Prec::Postfix, "operator->"},
{"pt", OperatorInfo::Member, /*Named*/ true, Node::Prec::Postfix,
"operator->"},
{"qu", OperatorInfo::Conditional, false, Node::Prec::Conditional,
"operator?"},
{"rM", OperatorInfo::Binary, false, Node::Prec::Assign, "operator%="},
Expand Down Expand Up @@ -3495,6 +3499,9 @@ AbstractManglingParser<Derived, Alloc>::parseOperatorName(NameState *State) {
if (Op->getKind() >= OperatorInfo::Unnameable)
/* Not a nameable operator. */
return nullptr;
if (Op->getKind() == OperatorInfo::Member && !Op->getFlag())
/* Not a nameable MemberExpr */
return nullptr;

return make<NameType>(Op->getName());
}
Expand Down
4 changes: 2 additions & 2 deletions 4 libcxxabi/test/test_demangle.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30248,8 +30248,6 @@ const char* cases[][2] = {
{"_Z3fooIPU9__ptrauthILj1ELb0ELj64EEPiEvT_", "void foo<int* __ptrauth<1u, false, 64u>*>(int* __ptrauth<1u, false, 64u>*)"},

{"_ZN1CpmEi", "C::operator->*(int)"},
{"_ZN1CdtEi", "C::operator.(int)"},
{"_ZN1CdsEi", "C::operator.*(int)"},
// clang-format on
};

Expand Down Expand Up @@ -30353,6 +30351,8 @@ const char *invalid_cases[] = {
"_ZGI3Foo",
"_ZGIW3Foov",
"W1x",
"_ZN1CdtEi",
"_ZN1CdsEi",
// clang-format on
};

Expand Down
15 changes: 11 additions & 4 deletions 15 llvm/include/llvm/Demangle/ItaniumDemangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -3389,8 +3389,10 @@ const typename AbstractManglingParser<
{"de", OperatorInfo::Prefix, false, Node::Prec::Unary, "operator*"},
{"dl", OperatorInfo::Del, /*Ary*/ false, Node::Prec::Unary,
"operator delete"},
{"ds", OperatorInfo::Member, false, Node::Prec::PtrMem, "operator.*"},
{"dt", OperatorInfo::Member, false, Node::Prec::Postfix, "operator."},
{"ds", OperatorInfo::Member, /*Named*/ false, Node::Prec::PtrMem,
"operator.*"},
{"dt", OperatorInfo::Member, /*Named*/ false, Node::Prec::Postfix,
"operator."},
{"dv", OperatorInfo::Binary, false, Node::Prec::Assign, "operator/"},
{"eO", OperatorInfo::Binary, false, Node::Prec::Assign, "operator^="},
{"eo", OperatorInfo::Binary, false, Node::Prec::Xor, "operator^"},
Expand Down Expand Up @@ -3419,10 +3421,12 @@ const typename AbstractManglingParser<
{"or", OperatorInfo::Binary, false, Node::Prec::Ior, "operator|"},
{"pL", OperatorInfo::Binary, false, Node::Prec::Assign, "operator+="},
{"pl", OperatorInfo::Binary, false, Node::Prec::Additive, "operator+"},
{"pm", OperatorInfo::Member, false, Node::Prec::PtrMem, "operator->*"},
{"pm", OperatorInfo::Member, /*Named*/ true, Node::Prec::PtrMem,
"operator->*"},
{"pp", OperatorInfo::Postfix, false, Node::Prec::Postfix, "operator++"},
{"ps", OperatorInfo::Prefix, false, Node::Prec::Unary, "operator+"},
{"pt", OperatorInfo::Member, false, Node::Prec::Postfix, "operator->"},
{"pt", OperatorInfo::Member, /*Named*/ true, Node::Prec::Postfix,
"operator->"},
{"qu", OperatorInfo::Conditional, false, Node::Prec::Conditional,
"operator?"},
{"rM", OperatorInfo::Binary, false, Node::Prec::Assign, "operator%="},
Expand Down Expand Up @@ -3495,6 +3499,9 @@ AbstractManglingParser<Derived, Alloc>::parseOperatorName(NameState *State) {
if (Op->getKind() >= OperatorInfo::Unnameable)
/* Not a nameable operator. */
return nullptr;
if (Op->getKind() == OperatorInfo::Member && !Op->getFlag())
/* Not a nameable MemberExpr */
return nullptr;

return make<NameType>(Op->getName());
}
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.