[PATCH] D33447: clang-format: add option to merge empty function body

Francois Ferrand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 12:04:28 PDT 2017


Typz added inline comments.


================
Comment at: include/clang/Format/Format.h:158
+  ///
+  bool AllowEmptyFunctionBodyOnASingleLine;
+
----------------
maybe this should be a nested option inside BraceWrapping?

or this should be donc implicit when breaking after function (BraceWrapping.AfterFunction = true) and AllowShortFunctionOnASingleLine (hence no option added) ? Or even AllowShortBlocksOnASingleLine (though the doc limits this option to statements...)


================
Comment at: unittests/Format/FormatTest.cpp:6131
   verifyFormat("union foo a = {bar};\nint n;");
 
   // Elaborate types inside function definitions.
----------------
missing test for parsing YAML option


https://reviews.llvm.org/D33447





More information about the cfe-commits mailing list