[PATCH] D93938: [clang-format] Fixed AfterEnum handling

Ally Tiritoglu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 3 12:22:33 PST 2021


atirit updated this revision to Diff 314299.
atirit added a comment.

Removed multiple enum names from new test


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93938

Files:
  clang/unittests/Format/FormatTest.cpp


Index: clang/unittests/Format/FormatTest.cpp
===================================================================
--- clang/unittests/Format/FormatTest.cpp
+++ clang/unittests/Format/FormatTest.cpp
@@ -1358,23 +1358,21 @@
 
   Style.AllowShortEnumsOnASingleLine = true;
   Style.BraceWrapping.AfterEnum = true;
-  verifyFormat("enum { A, B, C } Test1, AfterEnum2;", Style);
+  verifyFormat("enum { A, B, C } Test1;", Style);
   verifyFormat("enum\n"
                "{\n"
                "  A,\n"
                "  B, // foo\n"
                "  C\n"
-               "} Test2,\n"
-               "    AfterEnum2;",
+               "} Test2;",
                Style);
   Style.BraceWrapping.AfterEnum = false;
-  verifyFormat("enum { A, B, C } Test3, AfterEnum2;", Style);
+  verifyFormat("enum { A, B, C } Test3;", Style);
   verifyFormat("enum {\n"
                "  A,\n"
                "  B, // foo\n"
                "  C\n"
-               "} Test4,\n"
-               "    AfterEnum2;",
+               "} Test4;",
                Style);
 
   Style.AllowShortEnumsOnASingleLine = false;
@@ -1384,14 +1382,14 @@
                "  A,\n"
                "  B,\n"
                "  C\n"
-               "} Test5, AfterEnum2;",
+               "} Test5;",
                Style);
   Style.BraceWrapping.AfterEnum = false;
   verifyFormat("enum {\n"
                "  A,\n"
                "  B,\n"
                "  C\n"
-               "} Test6, AfterEnum2;",
+               "} Test6;",
                Style);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93938.314299.patch
Type: text/x-patch
Size: 1527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210103/9400c70f/attachment.bin>


More information about the cfe-commits mailing list