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

            Bug ID: 48707
           Summary: ColumnLimit=0 not respected on variable template
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

Here's a fairly silly header:

#include <functional>

#if 1
#  define VARIABLE_TEMPLATE_INLINE inline
#endif

template <class R, class F, class... Args>
VARIABLE_TEMPLATE_INLINE constexpr bool is_invocable_r_v
    = std::is_invocable_r_v<R, F, Args...>;

With the following .clang-format

BasedOnStyle: Google
ColumnLimit: 0
AlwaysBreakTemplateDeclarations: Yes

Formats as:

#include <functional>

#if 1
#define VARIABLE_TEMPLATE_INLINE inline
#endif

template <class R, class F, class... Args>
VARIABLE_TEMPLATE_INLINE constexpr bool is_invocable_r_v =
std::is_invocable_r_v<R, F, Args...>;


But I don't want this on one line, it's too long (and in my real code, the
right-hand side is a bit longer). I thought the point of ColumnLimit=0 is to
respect my spacing decisions, but instead this newline is removed.

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