HazardyKnusperkeks accepted this revision.
HazardyKnusperkeks added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2615
+      if (Current->isOneOf(tok::period, tok::arrow) &&
+          !Current->is(TT_TrailingReturnArrow)) {
         return PrecedenceArrowAndPeriod;
----------------



================
Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:448
+  EXPECT_EQ(Tokens[11]->FakeLParens.size(), 0u);
+  EXPECT_TOKEN(Tokens[5], tok::kw_requires, TT_RequiresClause);
+
----------------
rymiel wrote:
> MyDeveloperDay wrote:
> > should you not check that Tokens[21] is a TT_TrailingReturnArrow?
> That's probably a good idea, thank you! (though the bug wasn't that `->` was 
> misannotated, it was still a trailing return arrow, it just caused fake 
> parentheses to be inserted earlier on)
Can you add the test for `ClosesRequiresClause`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134049/new/

https://reviews.llvm.org/D134049

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to