MyDeveloperDay planned changes to this revision.
MyDeveloperDay marked 3 inline comments as done.
MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1566
       Current.Type = TT_TrailingReturnArrow;
-
+    } else if (Current.is(tok::arrow) && Current.Previous &&
+               Current.Previous->is(tok::r_brace)) {
----------------
miscco wrote:
> MyDeveloperDay wrote:
> > miscco wrote:
> > > Should that really be `tok::arrow` and not `tok::kw_requires`?
> > This is to prevent the breaking between } and -> in the following (which 
> > could be some way from the requires
> > 
> > `{ t.foo(u) } -> typename T::foo_type;`
> I believe this should carry some state that we are inside of an 
> requires-expression. 
I'm not sure how possible that is as its dealt with in terms of normal 
parseBlock() handling so there might not be a possiblity to label the -> (which 
is actually what I'm just doing here) the other rules regarding 
TT_TrailingReturnArrow will ensure its doesn't get broken and there is spaces 
around it.


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

https://reviews.llvm.org/D79773



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

Reply via email to