Skip to content

[ItaniumDemangle] Unconditionally parse substitution template arguments #131970

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions libcxxabi/src/demangle/ItaniumDemangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -4626,10 +4626,10 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
// <template-template-param> ::= <template-param>
// ::= <substitution>
//
// If this is followed by some <template-args>, and we're permitted to
// parse them, take the second production.
// If this is followed by some <template-args>, take the second
// production.

if (look() == 'I' && (!IsSubst || TryToParseTemplateArgs)) {
if (look() == 'I') {
if (!IsSubst)
Subs.push_back(Result);
Node *TA = getDerived().parseTemplateArgs();
Expand Down
1 change: 1 addition & 0 deletions libcxxabi/test/test_demangle.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30247,6 +30247,7 @@ const char* cases[][2] = {
{"_Z1fDSDRm", "f(_Sat unsigned long _Fract)"},

{"_Z11bfloat16addDF16bDF16b", "bfloat16add(std::bfloat16_t, std::bfloat16_t)"},
{"_ZNK4llvm11SmallStringILj16EEcvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEv", "llvm::SmallString<16u>::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>() const"},
// clang-format on
};

Expand Down
6 changes: 3 additions & 3 deletions llvm/include/llvm/Demangle/ItaniumDemangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -4626,10 +4626,10 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
// <template-template-param> ::= <template-param>
// ::= <substitution>
//
// If this is followed by some <template-args>, and we're permitted to
// parse them, take the second production.
// If this is followed by some <template-args>, take the second
// production.

if (look() == 'I' && (!IsSubst || TryToParseTemplateArgs)) {
if (look() == 'I') {
if (!IsSubst)
Subs.push_back(Result);
Node *TA = getDerived().parseTemplateArgs();
Expand Down
Loading