[PATCH] D75791: [clang-format] Added new option IndentExternBlock

Marcus Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 7 17:48:51 PST 2020


MarcusJohnson91 updated this revision to Diff 248975.
MarcusJohnson91 added a comment.

Updated the release notes


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

https://reviews.llvm.org/D75791

Files:
  clang/docs/ReleaseNotes.rst


Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -200,6 +200,23 @@
 ------------
 
 
+- Option ``IndentExternBlock`` has been added to optionally apply indenting inside extern "C" blocks.
+  
+  The ``BraceWrapping.AfterExternBlock`` option has been modified so it no longer indents when set to true, now it just wraps the braces around extern blocks.
+
+  .. code-block:: c++
+
+    true:                         false:
+      #ifdef __cplusplus          #ifdef __cplusplus
+      extern "C" {                extern "C" {
+      #endif                      #endif
+  
+          void f(void);           void f(void);
+  
+      #ifdef __cplusplus          #ifdef __cplusplus
+      }                           }
+      #endif                      #endif
+
 - Option ``IndentCaseBlocks`` has been added to support treating the block
   following a switch case label as a scope block which gets indented itself.
   It helps avoid having the closing bracket align with the switch statement's


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75791.248975.patch
Type: text/x-patch
Size: 1111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200308/6d25c897/attachment.bin>


More information about the cfe-commits mailing list