[PATCH] D59408: [clang-format] [PR25010] Extend AllowShortIfStatementsOnASingleLine not working if an "else" statement is present

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 20 04:02:33 PDT 2019


klimek added inline comments.


================
Comment at: clang/docs/ClangFormatStyleOptions.rst:401
+  * ``SIS_AlwaysNoElse`` (in configuration: ``AlwaysNoElse``)
+    Allow short if/else if statements even if the else is a compound statement.
+
----------------
I'd try to make this either unconditionally what we do, or decide against doing it.


================
Comment at: clang/include/clang/Format/Format.h:263-264
     SIS_WithoutElse,
-    /// Always put short ifs on the same line if
-    /// the else is not a compound statement or not.
+    /// If Else statements have no braces don't put them
+    /// on the same line.
+    /// \code
----------------
This seems weird - why would we want this?


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

https://reviews.llvm.org/D59408





More information about the cfe-commits mailing list