[llvm] Fix llvm::StripTemplateParameters to not return an empty name. (PR #157553)

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 10:25:18 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 ||
----------------
clayborg wrote:

correct. I can remove it. 

https://github.com/llvm/llvm-project/pull/157553


More information about the llvm-commits mailing list