owenpan 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 &&
----------------
It seems we can simply check if the line might be a function declaration here 
instead of resetting `AutoFound` below.


================
Comment at: clang/unittests/Format/TokenAnnotatorTest.cpp:1493
+
+  Tokens = annotate("auto foo() -> auto { return Val; }");
+  ASSERT_EQ(Tokens.size(), 12u) << Tokens;
----------------
Can this be valid C++?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147377

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

Reply via email to