Issue 182566
Summary [clang-format] Support ignoring implicit access modifiers
Labels clang-format
Assignees
Reporter nabelekt
    Please support ignoring implicit access modifiers. I want to get
```cpp
#pragma once

class ClassA
{
    public:

        struct type_a_t
        {
 type1_t a;
                type2_t b;
                type3_t c;
                type4_t d;

                // Conversion operator to MCC-generated config struct
                explicit operator type_b_t() const
                {
                    return type_b_t{ static_cast<uint8_t>(a),
 static_cast<uint16_t>(b),
 static_cast<uint32_t>(c),
 static_cast<float>(d) };
                };
        };
};
```
to look like
```
#pragma once

class ClassA
{
    public:

        struct type_a_t
        {
            type1_t a;
            type2_t b;
 type3_t c;
            type4_t d;

            // Conversion operator to MCC-generated config struct
            explicit operator type_b_t() const
            {
                return type_b_t
                {
 static_cast<uint8_t>(a),
 static_cast<uint16_t>(b),
                    static_cast<uint32_t>(c),
 static_cast<float>(d)
                };
            }
 };
};
```
there are a couple/few separate problems here, but the first is that within the braces for `struct type_a_t`, everything is indented twice because we have `IndentAccessModifiers: true` and there is an implicit access modifier at the start of the struct definition.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to