[PATCH] D115903: [clang-format] Extra spaces surrounding arrow in templated member call in variable decl

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 17 03:18:58 PST 2021


curdeius accepted this revision.
curdeius added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1682
                Current.NestingLevel == 0 &&
-               !Current.Previous->is(tok::kw_operator)) {
+               !Current.Previous->isOneOf(tok::kw_operator, tok::identifier)) {
       // not auto operator->() -> xxx;
----------------
MyDeveloperDay wrote:
> curdeius wrote:
> > Won't it break lambdas with an identifier (e.g. macro) before the arrow? E.g.:
> > ```
> > auto lmbd = [] NOEXCEPT -> int {
> >   return 0;
> > };
> > ```
> it doesn't seem so, maybe one of the other rules is catching that
> 
> auto lmbd = [] NOEXCEPT -> int { return 0; };
> 
Ok, but I'd like to see it as a test case if we don't have something similar already.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115903



More information about the cfe-commits mailing list