[PATCH] D120398: [format] follow up: Use unsigned char as the base of all enums in FormatStyle

Konrad Wilhelm Kleine via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 24 06:10:31 PST 2022


kwk updated this revision to Diff 411105.
kwk added a comment.

Rebased on upstream/main


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120398

Files:
  clang/include/clang/Format/Format.h


Index: clang/include/clang/Format/Format.h
===================================================================
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -105,7 +105,7 @@
   BracketAlignmentStyle AlignAfterOpenBracket;
 
   /// Different style for aligning array initializers.
-  enum ArrayInitializerAlignmentStyle {
+  enum ArrayInitializerAlignmentStyle : unsigned char {
     /// Align array column and left justify the columns e.g.:
     /// \code
     ///   struct test demo[] =
@@ -140,7 +140,7 @@
   /// ``AlignConsecutiveBitFields``), names in declarations (see
   /// ``AlignConsecutiveDeclarations``) or macro definitions (see
   /// ``AlignConsecutiveMacros``).
-  enum AlignConsecutiveStyle {
+  enum AlignConsecutiveStyle : unsigned char {
     ACS_None,
     ACS_Consecutive,
     ACS_AcrossEmptyLines,
@@ -1771,7 +1771,7 @@
   BraceWrappingFlags BraceWrapping;
 
   /// Different ways to break before concept declarations.
-  enum BreakBeforeConceptDeclarationsStyle {
+  enum BreakBeforeConceptDeclarationsStyle : unsigned char {
     /// Keep the template declaration line together with ``concept``.
     /// \code
     ///   template <typename T> concept C = ...;
@@ -1882,7 +1882,7 @@
   std::string CommentPragmas;
 
   /// Different specifiers and qualifiers alignment styles.
-  enum QualifierAlignmentStyle {
+  enum QualifierAlignmentStyle : unsigned char {
     /// Don't change specifiers/qualifiers to either Left or Right alignment
     /// (default).
     /// \code
@@ -3067,7 +3067,7 @@
   std::vector<RawStringFormat> RawStringFormats;
 
   /// \brief The ``&`` and ``&&`` alignment style.
-  enum ReferenceAlignmentStyle {
+  enum ReferenceAlignmentStyle : unsigned char {
     /// Align reference like ``PointerAlignment``.
     RAS_Pointer,
     /// Align reference to the left.
@@ -3166,7 +3166,7 @@
   /// \brief The possible positions for the requires clause. The
   /// ``IndentRequires`` option is only used if the ``requires`` is put on the
   /// start of a line.
-  enum RequiresClausePositionStyle {
+  enum RequiresClausePositionStyle : unsigned char {
     /// Always put the ``requires`` clause on its own line.
     /// \code
     ///   template <typename T>
@@ -3245,7 +3245,7 @@
   RequiresClausePositionStyle RequiresClausePosition;
 
   /// \brief The style if definition blocks should be separated.
-  enum SeparateDefinitionStyle {
+  enum SeparateDefinitionStyle : unsigned char {
     /// Leave definition blocks as they are.
     SDS_Leave,
     /// Insert an empty line between definition blocks.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120398.411105.patch
Type: text/x-patch
Size: 2595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220224/323fa90b/attachment.bin>


More information about the cfe-commits mailing list