[PATCH] D79020: [clang-format] Correct the AfterControlStatement configuration option output style

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 03:21:24 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG573322694ad3: [clang-format] Correct the AfterControlStatement configuration option output… (authored by MyDeveloperDay).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79020

Files:
  clang/lib/Format/Format.cpp


Index: clang/lib/Format/Format.cpp
===================================================================
--- clang/lib/Format/Format.cpp
+++ clang/lib/Format/Format.cpp
@@ -195,11 +195,13 @@
   static void
   enumeration(IO &IO,
               FormatStyle::BraceWrappingAfterControlStatementStyle &Value) {
-    IO.enumCase(Value, "false", FormatStyle::BWACS_Never);
-    IO.enumCase(Value, "true", FormatStyle::BWACS_Always);
     IO.enumCase(Value, "Never", FormatStyle::BWACS_Never);
     IO.enumCase(Value, "MultiLine", FormatStyle::BWACS_MultiLine);
     IO.enumCase(Value, "Always", FormatStyle::BWACS_Always);
+
+    // For backward compatibility.
+    IO.enumCase(Value, "false", FormatStyle::BWACS_Never);
+    IO.enumCase(Value, "true", FormatStyle::BWACS_Always);
   }
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79020.261174.patch
Type: text/x-patch
Size: 784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200430/10f00d9f/attachment.bin>


More information about the cfe-commits mailing list