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

            Bug ID: 40254
           Summary: Sporadic incorrect white space difference flagged by
                    clang-format
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: hgrev...@google.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org

Created attachment 21304
  --> https://bugs.llvm.org/attachment.cgi?id=21304&action=edit
patch.diff to reproduce

I haven't been able to get a small reproducer, the error seems to happen
sometimes dependent on random line changes. Easiest way is (all open source):

1) git clone g...@github.com:DynamoRIO/dynamorio.git (or use https:// as in
https://github.com/DynamoRIO/dynamorio)

2) Go to revision git checkout 425413dbf134a46ae7a43d59b683ab350d72a85b

3) git apply patch.diff

4) git diff | ./clang-format-diff.py -p1
--- suite/tests/client-interface/mangle_suspend.c       (before formatting)
+++ suite/tests/client-interface/mangle_suspend.c       (after formatting)
@@ -288,5 +288,5 @@

 END_FILE

-/* clang-format on */
-#endif
+        /* clang-format on */
+#endif

The problem is the random white space in "after formatting" that sometimes
seems to happen dependent on random line changes. I have not been able to find
a deterministic way, in particular a smaller example to reproduce other than
this one.

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