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

            Bug ID: 35033
           Summary: clang-format reformats already formatted code (comment
                    before preprocessor directive)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: curde...@gmail.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org

Tested on clang-format trunk r316311 from 2017-10-23.

The following code:

```
{
  // clang-format off
  #define M 5
}
```

gets formmatted to:

```
{
// clang-format off
  #define M 5
}
```

Reformatting again leads to the original code again... and it cycles.

Apparently, it has to do with comments before preprocessor directives and seems
to be related to bug #31911 (https://bugs.llvm.org/show_bug.cgi?id=31911).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to