[llvm-bugs] [Bug 38395] New: Weird indentation for ref-qualified, noexcept, template methods

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 31 15:12:24 PDT 2018


            Bug ID: 38395
           Summary: Weird indentation for ref-qualified, noexcept,
                    template methods
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: redbeard0531 at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

This is a subset of https://bugs.llvm.org/show_bug.cgi?id=36857 that I've found
a precise, small trigger for. It only happens when a single method is all of
ref-qualified, noexcept, and a template. This specific repo uses
"AlwaysBreakTemplateDeclarations: true", but with a long enough template line
that it would break there anyway, it repros even with default settings.


> clang-format -style='{AlwaysBreakTemplateDeclarations: true}' example.cpp 

struct Struct {
  // Weird indenetation for when all three are true for a single method:
  template <typename T>
      void ref_qualified_noexcept_template() && noexcept {}

  // Any two is fine though:

  void not_a_template() && noexcept {}

  template <typename T>
  void not_noexcept() && {}

  template <typename T>
  void not_ref_qualified() noexcept {}

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/20180731/105a6b52/attachment.html>

More information about the llvm-bugs mailing list