================ @@ -243,14 +244,16 @@ class AnnotatingParser { // operator that was misinterpreted because we are parsing template // parameters. // FIXME: This is getting out of hand, write a decent parser. - if (InExpr && !Line.startsWith(tok::kw_template) && + if (InExpr && !SeenFatArrow && !Line.startsWith(tok::kw_template) && Prev.is(TT_BinaryOperator)) { const auto Precedence = Prev.getPrecedence(); if (Precedence > prec::Conditional && Precedence < prec::Relational) return false; } if (Prev.isOneOf(tok::question, tok::colon) && !Style.isProto()) SeenTernaryOperator = true; + else if (Prev.is(TT_FatArrow)) ---------------- kadircet wrote:
i don't think new or empty parantheses are a must either, the logic around here is just checking that `<>` are inside an expression, hence that kind of code pattern is likely quite common as people tend to do arithmetic via metaprogramming using these patterns. e.g: ```cpp constexpr auto foo() { return FixedInt<N | M>(foo); } ``` this will be formatted as the following now: ```cpp constexpr auto foo() { return FixedInt < N | M > (foo); } ``` https://github.com/llvm/llvm-project/pull/108671 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits