[llvm-bugs] [Bug 51860] New: Add style to AlignConsecutiveStyle to AlignConsecutiveDeclarations only on function parameters

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 14 13:11:07 PDT 2021


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

            Bug ID: 51860
           Summary: Add style to AlignConsecutiveStyle to
                    AlignConsecutiveDeclarations only on function
                    parameters
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mail at 3v1n0.net
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

In mutter and many other GNOME projects we want to have aligned delclarations
only for function parameters, while we don't want to keep all the struct and
function declarations aligned.

This is currently not possible with clang-format, as the only way to have
something like:

```
static MetaDeviceFile *
meta_kms_impl_device_open_device_file (MetaKmsImplDevice *impl_device,
                                       const char        *path,
                                       GError           **error);
```

Needs AlignConsecutiveDeclarations, but then we'd also have:

```
drmModePropertyRes *drm_prop;
MetaKmsProp        *prop;
```

While we don't want `prop` to be aligned.

-- 
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/20210914/96c93cca/attachment.html>


More information about the llvm-bugs mailing list