[llvm-bugs] [Bug 52488] New: formatting does not break constructor

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 12 05:03:13 PST 2021


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

            Bug ID: 52488
           Summary: formatting does not break constructor
           Product: clang-tools-extra
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: clangd
          Assignee: unassignedclangbugs at nondot.org
          Reporter: samisserious-bugs at yahoo.de
                CC: llvm-bugs at lists.llvm.org

Created attachment 25445
  --> https://bugs.llvm.org/attachment.cgi?id=25445&action=edit
demonstration code

// The Epsilon constructor is not formatted nicely

namespace foo {
struct AlphaStruct {
    int aMember;
    int bLongMember;
};
} // namespace foo

struct BetaStruct {
    foo::AlphaStruct anotherMember;
    foo::AlphaStruct bMember;
};

struct CommaStruct {
    BetaStruct aMember;
    CommaStruct(BetaStruct member)
    : aMember{member} {
    }
};


struct Epsilon : public CommaStruct {
    int content;

    explicit Epsilon() : CommaStruct{ BetaStruct{.anotherMember =
foo::AlphaStruct{1, 100}, .bMember = foo::AlphaStruct{100000 - 1000, 10000 -
10000}}} , content{1} {
    }
};

auto main() -> int {
    return 0;
}

-- 
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/20211112/a3071f3f/attachment.html>


More information about the llvm-bugs mailing list