[PATCH] D63062: [clang-format] Added New Style Rule: BitFieldDeclsOnSeparateLines

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 10 08:52:16 PDT 2019


mgorny requested changes to this revision.
mgorny added inline comments.
This revision now requires changes to proceed.


================
Comment at: docs/ClangFormatStyleOptions.rst:195
+**BitFieldDeclsOnSeparateLines** (``bool``)
+  If ``true``, Align Bitfield Declarations on seperate lines.
+
----------------
'separate'


================
Comment at: include/clang/Format/Format.h:104
 
+  /// If ``true``, Linesup Bitfield Declarations.
+  /// This will lineup Bitfield declarations on consecutive lines. This
----------------
Also update this to match docs.


================
Comment at: lib/Format/ContinuationIndenter.cpp:281
   assert(&Previous == Current.Previous);
+  if(Previous.is(tok::comma) && Style.BitFieldDeclsOnSeparateLines && Current.is(tok::identifier)){
+      if(Current.Next->is(tok::colon))
----------------
Space after 'if' and before '{'. Also below.


================
Comment at: lib/Format/TokenAnnotator.cpp:2921
+      Right.is(tok::identifier) && (Right.Next->is(tok::colon)))
+      return true;
   if (Right.NewlinesBefore > 1 && Style.MaxEmptyLinesToKeep > 0)
----------------
Misindent.


Repository:
  rC Clang

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

https://reviews.llvm.org/D63062





More information about the cfe-commits mailing list