[llvm-bugs] [Bug 50680] New: [clang-format] strange behavior for #define macro with braces

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 11 06:36:20 PDT 2021


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

            Bug ID: 50680
           Summary: [clang-format] strange behavior for #define macro with
                    braces
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pryga.piotr at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

When there is a #define macro that starts with brace, then clang-format seems
to be treating it a if it is a struct/class declaration, e.g.

#define RAW {1}, {2}, {3}

is formated into this:

#define RAW           \
        { 1 }, { 2 }, \
        {             \
                3     \
        }

It seems to be that it should stay not changed at all.

I'm using clang-12 with .clang-format as the one here: 
https://github.com/zephyrproject-rtos/zephyr/blob/main/.clang-format

-- 
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/20210611/d9b1b464/attachment-0001.html>


More information about the llvm-bugs mailing list