[PATCH] D147377: [clang-format] Don't allow variable decls to have trailing return arrows

Emilia Dreamer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 2 01:13:49 PDT 2023


rymiel added inline comments.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1922
     } else if (Current.is(tok::arrow) && AutoFound &&
                (Line.MustBeDeclaration || Line.InPPDirective) &&
                Current.NestingLevel == 0 &&
----------------
owenpan wrote:
> It seems we can simply check if the line might be a function declaration here instead of resetting `AutoFound` below.
I could swear I specifically tried using that flag and it didn't work in all cases, but I guess I did something wrong back then...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147377



More information about the cfe-commits mailing list