[llvm-bugs] [Bug 37706] New: Allow modifiers (static, constexpr) on separate-ish line

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 6 09:42:49 PDT 2018


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

            Bug ID: 37706
           Summary: Allow modifiers (static, constexpr) on separate-ish
                    line
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: matthew.woehlke at kitware.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

I'm having a number of issues trying to get clang-format to behave reasonably
on
https://github.com/Kitware/kwiver/blob/303a11ebb43c020ab8e48b6ef70407b460dba46b/vital/range/defs.h,
using
https://gist.github.com/mwoehlke-kitware/d8ef9466df5096a035059938aef2948d.

For this RFE, specifically, I have AlwaysBreakTemplateDeclarations enabled,
which is good, but I also want the equivalent for non-type modifiers, e.g.
`inline`, `static` and `constexpr` (and probably attributes). Ideally I would
like these on the same line as `template`, but I would settle for `template`,
attributes, and the rest of the above being on their own lines, provided that
the keywords in the last category are kept on the *same* line. (In particular,
see how clang-format butchers the end of KWIVER_RANGE_ADAPTER_TEMPLATE in the
code mentioned above.)

So, specifically:

  // best
  template <typename T> static
  void foo()

  // okay
  template <typename T>
  static
  void foo()

  // wrong
  static void foo()

-- 
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/20180606/ee83a487/attachment.html>


More information about the llvm-bugs mailing list