[clang] [clang-format] Handle templates in qualified typenames (PR #143194)
Ben Dunkin via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 12 15:59:50 PDT 2025
================
@@ -3622,6 +3622,29 @@ static unsigned maxNestingDepth(const AnnotatedLine &Line) {
return Result;
}
+static bool startsQualifiedName(const FormatToken *Tok) {
+ // Consider: A::B::B()
+ // Tok --^
+ if (Tok->startsSequence(tok::identifier, tok::coloncolon))
+ return true;
+
+ // Consider: A<float>::B<int>::B()
+ // Tok --^
+ if (Tok->startsSequence(tok::identifier, TT_TemplateOpener)) {
+ Tok = Tok->getNextNonComment();
+ assert(Tok);
----------------
bdunkin wrote:
Done.
https://github.com/llvm/llvm-project/pull/143194
More information about the cfe-commits
mailing list