[clang] [clang-format] Handle templates in qualified typenames (PR #143194)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 12 01:57:49 PDT 2025


================
@@ -3659,9 +3697,23 @@ static FormatToken *getFunctionName(const AnnotatedLine &Line,
     }
 
     // Skip to the unqualified part of the name.
-    while (Tok->startsSequence(tok::identifier, tok::coloncolon)) {
-      assert(Tok->Next);
-      Tok = Tok->Next->Next;
+    while (startsQualifiedName(Tok)) {
----------------
HazardyKnusperkeks wrote:

Can you change the return value of `startsQualifiedName`, so that it returns the `Tok` to continue and you don't need to recheck for the template?

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


More information about the cfe-commits mailing list