[PATCH] D78694: [clang-format] Fix lambda with ellipsis in return type

Pochang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 23 20:07:06 PDT 2020


johnchen902 updated this revision to Diff 259792.
johnchen902 added a comment.

Rebased to HEAD.


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

https://reviews.llvm.org/D78694

Files:
  clang/lib/Format/UnwrappedLineParser.cpp
  clang/unittests/Format/FormatTest.cpp


Index: clang/unittests/Format/FormatTest.cpp
===================================================================
--- clang/unittests/Format/FormatTest.cpp
+++ clang/unittests/Format/FormatTest.cpp
@@ -14111,6 +14111,8 @@
                "    -> int {\n"
                "  return 1; //\n"
                "};");
+  verifyFormat("[]() -> Void<T...> {};");
+  verifyFormat("[a, b]() -> Tuple<T...> { return {}; };");
 
   // Lambdas with explicit template argument lists.
   verifyFormat(
Index: clang/lib/Format/UnwrappedLineParser.cpp
===================================================================
--- clang/lib/Format/UnwrappedLineParser.cpp
+++ clang/lib/Format/UnwrappedLineParser.cpp
@@ -1626,6 +1626,7 @@
     case tok::lessequal:
     case tok::question:
     case tok::colon:
+    case tok::ellipsis:
     case tok::kw_true:
     case tok::kw_false:
       if (SeenArrow) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78694.259792.patch
Type: text/x-patch
Size: 886 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200424/5a977bdf/attachment.bin>


More information about the cfe-commits mailing list