diff --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h index 3df41b5f4d7d0..45ec8d41fee41 100644 --- a/libcxxabi/src/demangle/ItaniumDemangle.h +++ b/libcxxabi/src/demangle/ItaniumDemangle.h @@ -4626,10 +4626,10 @@ Node *AbstractManglingParser::parseType() { // ::= // ::= // - // If this is followed by some , and we're permitted to - // parse them, take the second production. + // If this is followed by some , take the second + // production. - if (look() == 'I' && (!IsSubst || TryToParseTemplateArgs)) { + if (look() == 'I') { if (!IsSubst) Subs.push_back(Result); Node *TA = getDerived().parseTemplateArgs(); diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp index e9c74f70a094b..fad6c101f742d 100644 --- a/libcxxabi/test/test_demangle.pass.cpp +++ b/libcxxabi/test/test_demangle.pass.cpp @@ -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, std::allocator>() const"}, // clang-format on }; diff --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h index b0363c1a7a786..15400694b3c70 100644 --- a/llvm/include/llvm/Demangle/ItaniumDemangle.h +++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h @@ -4626,10 +4626,10 @@ Node *AbstractManglingParser::parseType() { // ::= // ::= // - // If this is followed by some , and we're permitted to - // parse them, take the second production. + // If this is followed by some , take the second + // production. - if (look() == 'I' && (!IsSubst || TryToParseTemplateArgs)) { + if (look() == 'I') { if (!IsSubst) Subs.push_back(Result); Node *TA = getDerived().parseTemplateArgs();