[llvm-bugs] [Bug 52487] New: formatting adds too many whitespace

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


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

            Bug ID: 52487
           Summary: formatting adds too many whitespace
           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 25443
  --> https://bugs.llvm.org/attachment.cgi?id=25443&action=edit
demonstration code

// In the DeltaStruct constructor, the nested .aMember has too many whitespaces

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 DeltaStruct : public CommaStruct {
    DeltaStruct()
    : CommaStruct(BetaStruct{
        .anotherMember = foo::AlphaStruct{   .aMember = 1, .bLongMember = 100},
        .bMember = foo::AlphaStruct{.aMember = 1000,   .bLongMember = 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/3bc3e9f3/attachment-0001.html>


More information about the llvm-bugs mailing list