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

            Bug ID: 50317
           Summary: BreakBeforeBinaryOperators incorrect namespace-id
                    handling in requires-clause
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

In template head and in function body, BreakBeforeBinaryOperators has
consistent behavior. However, in requires-clause, when
BreakBeforeBinaryOperators is not 'None', it puts break after namespace-id.

With BreakBeforeBinaryOperators: NonAssignment:
template <typename T =
              std::xxxxxxxxxxxxxxxxxxxxxxx()
              && std::yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy()>
requires std::xxxxxxxxxxxxxxxxxxxxxxx() && std::
    yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy()
void test() {
  const b = std::xxxxxxxxxxxxxxxxxxxxxxx()
            && std::yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy();
}

With BreakBeforeBinaryOperators: None everything is OK:
template <typename T =
              std::xxxxxxxxxxxxxxxxxxxxxxx() &&
              std::yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy()>
requires std::xxxxxxxxxxxxxxxxxxxxxxx() &&
    std::yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy()
void test() {
  const b = std::xxxxxxxxxxxxxxxxxxxxxxx() &&
            std::yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy();
}

-- 
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