Index: clang/lib/Format/UnwrappedLineParser.h =================================================================== --- clang/lib/Format/UnwrappedLineParser.h +++ clang/lib/Format/UnwrappedLineParser.h @@ -118,6 +118,7 @@ tok::TokenKind ClosingBraceKind = tok::r_brace); void parseParens(TokenType AmpAmpTokenType = TT_Unknown); void parseSquare(bool LambdaIntroducer = false); + void parseTemplateArguments(); void keepAncestorBraces(); FormatToken *parseIfThenElse(IfStmtKind *IfKind, bool KeepBraces = false); void parseTryCatch(); Index: clang/lib/Format/UnwrappedLineParser.cpp =================================================================== --- clang/lib/Format/UnwrappedLineParser.cpp +++ clang/lib/Format/UnwrappedLineParser.cpp @@ -2289,6 +2289,21 @@ } while (!eof()); } +/// \brief Parses a template arguments, that is from the opening < to the +/// closing >. Returns when it succesfully read the template arguments or +/// detected that it's not a template argument list. +void clang::format::UnwrappedLineParser::parseTemplateArguments() { + assert(FormatTok->is(tok::less) && "'<' expected."); + assert(FormatTok->is(TT_Unknown) && "Type already set on '<'"); + auto OpeningAngle = FormatTok; + nextToken(); + + + do { + //Do stuff + } while (!eof()); +} + void UnwrappedLineParser::keepAncestorBraces() { if (!Style.RemoveBracesLLVM) return;