[llvm-bugs] [Bug 40480] New: clang-format gets confused with custom for each macro

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jan 26 09:06:35 PST 2019


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

            Bug ID: 40480
           Summary: clang-format gets confused with custom for each macro
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: patrick.pelissier at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

For the test case below that uses a for each macro M_EACH provided by some
library to iterate over a container:

int f(aint_t a)
{
  int s = 0;
  for M_EACH(item, a, aint_t) {
      int z = *item;
      s += z;
  }
  return s;
}

is transformed into:

int f(aint_t a) {
  int s = 0;
  for
    M_EACH(item, a, aint_t) {
      int z = *item;
      s += z;
    }
  return s;
}

There is no option to prevent the end of line after the for and before the
M_EACH macro.

-- 
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/20190126/85af6e8d/attachment-0001.html>


More information about the llvm-bugs mailing list