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

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 1 12:34:48 PDT 2025


================
@@ -3632,6 +3632,36 @@ static unsigned maxNestingDepth(const AnnotatedLine &Line) {
   return Result;
 }
 
+// Returns the token after the first qualifier of the name, or nullptr if there
+// is no qualifier.
+static FormatToken *skipNameQualifier(const FormatToken *Tok) {
+  // Qualified names must start with an identifier.
+  if (!Tok->is(tok::identifier))
+    return nullptr;
+
+  Tok = Tok->getNextNonComment();
+  if (Tok == nullptr)
----------------
owenca wrote:

```suggestion
  if (!Tok)
```

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


More information about the cfe-commits mailing list