================ @@ -3903,6 +3903,15 @@ void UnwrappedLineParser::parseRecord(bool ParseAsExpr) { parseParens(); } + auto IsTemplate = [&] { + FormatToken *Tok = InitialToken.Previous; + while (Tok) { + if (Tok->is(tok::kw_template)) + return true; + Tok = Tok->Previous; + } + return false; + }; // Note that parsing away template declarations here leads to incorrectly ---------------- XDeme wrote:
Yes that comment would need to change a bit, I tested here again, and I noticed that a template method is still detected as a class declaration with this current patch: ```cpp struct Foo { template<typename T> struct Goo<T> g() {} }; ``` The patch could be changed to check if the identifier before a `tok::l_paren` is a macro, and if it is, detect it as a class. But I am not sure if this type of check is OK. https://github.com/llvm/llvm-project/pull/77013 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits