[llvm-bugs] [Bug 40446] New: Align Braces of Single Line Methods with clang format

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 24 08:47:27 PST 2019


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

            Bug ID: 40446
           Summary: Align Braces of Single Line Methods with clang format
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: adishavit at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Say I have the following C++ code:

class Foo
{
   auto foo() { return 0; } // foo
   auto foofoo() const { return 1000; } // foofoo
   int bar() const { return 42; } // bar
};
How can I get clang-format for align the braces (and comments too):

class Foo
{
   auto foo()          { return 0;    } // foo
   auto foofoo() const { return 1000; } // foofoo
   int  bar()    const { return 42;   } // bar
   //            ^-----^--------------^  ALIGNED
};
(In fact, it would be nice to align consecutive method (const) qualifiers as
well).

cc:
https://stackoverflow.com/questions/53986605/align-braces-of-single-line-methods-with-clang-format

-- 
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/20190124/cebbd0be/attachment.html>


More information about the llvm-bugs mailing list