[llvm] Fix llvm::StripTemplateParameters to not return an empty name. (PR #157553)
Michael Buch via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 11 23:57:17 PDT 2025
================
@@ -1117,7 +1117,8 @@ std::optional<StringRef> llvm::StripTemplateParameters(StringRef Name) {
//
// We look for > at the end but if it does not contain any < then we
// have something like operator>>. We check for the operator<=> case.
- if (!Name.ends_with(">") || Name.count("<") == 0 || Name.ends_with("<=>"))
+ if (Name.starts_with("<") || !Name.ends_with(">") || Name.count("<") == 0 ||
----------------
Michael137 wrote:
We don't need this `Name.starts_with("<")` check anymore right?
https://github.com/llvm/llvm-project/pull/157553
More information about the llvm-commits
mailing list