[llvm-bugs] [Bug 48707] New: ColumnLimit=0 not respected on variable template

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 10 11:10:07 PST 2021


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: unassignedclangbugs at nondot.org
          Reporter: barry.revzin at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210110/146e9f54/attachment.html>


More information about the llvm-bugs mailing list