lichray added inline comments.

================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1400
       Current.Type = TT_TrailingReturnArrow;
+    } else if (Current.Previous && Current.Previous->is(tok::r_paren) &&
+               Current.startsSequence(tok::arrow, tok::identifier, tok::less)) 
{
----------------
klimek wrote:
> Why doesn't this trigger on function templates:
>   c()->f<int>();
> 
Comparing to the `else if` branch above, several questions can arise:

1. Has deduction-guide be considered a declaration (it is, of course, in 
standard)?  If yes, without `MustBeDeclaration`, how `x = p->foo<3>();` being 
formatted?
2. Without restrictions on `NestingLevel`, how `A() -> 
A<decltype(p->foo<3>())>;` being formatted?
3. How `x()->foo<1>;` being formatted?  What's the difference between this and 
a deduction-guide?  A deduction-guide has to follow `TheSameType(...) -> 
TheSameType<....>;` and appears only at namespace level, do these help?

Oh no, `auto x = p -> foo<1>();` this is a bug (I will look for bug reports, 
don't mind).


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

https://reviews.llvm.org/D69577



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

Reply via email to