[llvm-bugs] [Bug 34778] New: BraceWrapping: SplitEmptyRecord ignored when AfterFunction is true

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 29 05:20:28 PDT 2017


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

            Bug ID: 34778
           Summary: BraceWrapping: SplitEmptyRecord ignored when
                    AfterFunction is true
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gerbo.engels at ortec-finance.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

The following works as expected:

$ echo "template<typename T> struct X{};" | clang-format -style="{BasedOnStyle:
llvm, BreakBeforeBraces: Custom, BraceWrapping: { AfterFunction: false,
AfterStruct: true, SplitEmptyRecord: false}}"
template <typename T> struct X
{};

Change AfterFunction to true:

$ echo "template<typename T> struct X{};" | clang-format -style="{BasedOnStyle:
llvm, BreakBeforeBraces: Custom, BraceWrapping: { AfterFunction: true,
AfterStruct: true, SplitEmptyRecord: false}}"
template <typename T> struct X
{
};

I would not expect AfterFunction to interfere with the formatting of a struct
(combined with SplitEmptyRecord).

Might be related to https://bugs.llvm.org/show_bug.cgi?id=25132 and
https://bugs.llvm.org/show_bug.cgi?id=34008

-- 
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/20170929/77ea80b2/attachment.html>


More information about the llvm-bugs mailing list