[llvm-bugs] [Bug 51955] New: Incorrect formatting of template with less-than operator

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 24 05:49:13 PDT 2021


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

            Bug ID: 51955
           Summary: Incorrect formatting of template with less-than
                    operator
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mats.nilsson at zenseact.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

I think this is a bug with the clang-formatter, where the "<" should have
spaces around it, but it seems it is interpreted incorrectly.

Minimal example with default google style would be:

#include <cstdint>

class foo {
  template <typename T, std::size_t dimension,
            std::enable_if_t<dimension<4U, bool> = true> void foobar() {
    // do something
  }
}

I would have wanted this:
- std::enable_if_t<dimension<4U, bool> = true> void foobar() {
+ std::enable_if_t<dimension < 4U, bool> = true> void foobar() {

-- 
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/20210924/028496c1/attachment.html>


More information about the llvm-bugs mailing list