================ @@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo<T>) && Bar;"); ASSERT_EQ(Tokens.size(), 19u) << Tokens; EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator); + + Tokens = annotate("void f() & requires(C<decltype(x)>) {}"); + ASSERT_EQ(Tokens.size(), 18u) << Tokens; + EXPECT_TOKEN(Tokens[4], tok::amp, TT_PointerOrReference); + EXPECT_TOKEN(Tokens[5], tok::kw_requires, TT_RequiresClause); + + Tokens = annotate("auto f() -> int& requires(C<decltype(x)>) {}"); + ASSERT_EQ(Tokens.size(), 20u) << Tokens; + EXPECT_TOKEN(Tokens[6], tok::amp, TT_PointerOrReference); + EXPECT_TOKEN(Tokens[7], tok::kw_requires, TT_RequiresClause); } ---------------- HazardyKnusperkeks wrote:
I have no problem with removing it. If you keep it, I would add a check for `OpenAngles == 0`. The same applies to `||` because one could write something like ```c++ requires (T<C1 || C2> t) {} ``` So the whole logic should only apply to the out of template area, similar to `const`, `volatile`, and `comma` above. https://github.com/llvm/llvm-project/pull/78847 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits