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

            Bug ID: 45408
           Summary: `[type] constexpr` followed by multiple variable
                    declarations is indented oddly
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

Given this code containing four similar-looking declarations:

/tmp $ cat test.cpp 
const int 
a1 = 1,
a2 = 2,
a3 = 3;

int const
b1 = 1,
b2 = 2,
b3 = 3;

constexpr int 
c1 = 1,
c2 = 2,
c3 = 3;

int constexpr
d1 = 1,
d2 = 2,
d3 = 3;

I would expect all four declarations to be indented the same way. However, the
last one is handled completely differently:

/tmp $ clang-format --style='{ColumnLimit: 0}' test.cpp
const int 
    a1 = 1,
    a2 = 2,
    a3 = 3;

int const
    b1 = 1,
    b2 = 2,
    b3 = 3;

constexpr int 
    c1 = 1,
    c2 = 2,
    c3 = 3;

int constexpr d1 = 1,
              d2 = 2,
              d3 = 3;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to