[llvm-bugs] [Bug 45816] New: Bit field alignment

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 6 10:36:17 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45816

            Bug ID: 45816
           Summary: Bit field alignment
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dmitriy.ovdienko at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

In addition to `AlignConsecutiveDeclarations` and `AlignConsecutiveAssignments`
parameters I'd like clang-format to align bit fields.

Given unformatted C++ header file:

struct Options {
  bool some_field : 1;
  bool some_another_field : 1;
  int yet_another_field : 1;
};

And .clang-format file:

---
AlignConsecutiveDeclarations: 'true'
AlignConsecutiveAssignments: 'true'
# New parameter
AlignConsecutiveBitFields: 'true'
...

I'd like clang-format to convert my header file into:

struct Options {
  bool some_field         : 1;
  bool some_another_field : 1;
  int  yet_another_field  : 1;
};

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200506/40954f8a/attachment.html>


More information about the llvm-bugs mailing list