[llvm-bugs] [Bug 48895] New: Function with unparenthesized trailing requires-expression always put on a single line

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 26 19:16:06 PST 2021


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

            Bug ID: 48895
           Summary: Function with unparenthesized trailing
                    requires-expression always put on a single line
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: johelegp at gmail.com
                CC: djasper at google.com, johelegp at gmail.com,
                    klimek at google.com, llvm-bugs at lists.llvm.org

.clang-format:
```
BasedOnStyle: LLVM
AllowShortFunctionsOnASingleLine: None
```

Input and expected formatted result:
```C++
auto f(int l, int r) requires requires {
  l *r;
}
{
  return l * r;
}
```

Actual output:
```C++
auto f(int l, int r) requires requires {
  l *r;
}
{ return l * r; }
```

Because this works fine as input and actual formatted output:
```C++
auto f(int l, int r) requires requires {
  l *r;
}
{
  return l * r;
  return l * r;
}
```

-- 
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/20210127/5d583b1d/attachment.html>


More information about the llvm-bugs mailing list