[llvm-bugs] [Bug 45992] New: clang-format deletes whitespace before ref-qualifier in user-defined conversion type-id

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 19 08:47:22 PDT 2020


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

            Bug ID: 45992
           Summary: clang-format deletes whitespace before ref-qualifier
                    in user-defined conversion type-id
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jfreeman08 at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Compare two consecutive commits:

- parent:
https://github.com/ripple/rippled/commit/97712107b71a8e2089d2e3fcef9ebf5362951110
- child:
https://github.com/ripple/rippled/commit/fdf6b09433cb4ca9872b89ed3419e0f594523442

The file `src/test/unit_test/SuiteJournal.h` is unchanged between them. They
both had checks that ran clang-format on that file. You can find the logs of
the checks by clicking the red x or green check in the top left before the
commit message, then clicking "Details" for "clang-format / check". I'll link
them here:

- parent: https://github.com/ripple/rippled/runs/647802934
- child: https://github.com/ripple/rippled/runs/687680298

They ended up running two slightly different versions of clang-format available
on different days through the official PPA (check the "Install clang-format"
step):

- parent: 10.0.1~++20200504072809+8e7ae355ba9-1~exp1~20200504054307.155
- child: 10.0.1~++20200518104422+eaae6dfc545-1~exp1~20200518085019.161

The latter version reformatted the file `src/test/unit_test/SuiteJournal.h`
while the earlier did not:

```
--- a/src/test/unit_test/SuiteJournal.h
+++ b/src/test/unit_test/SuiteJournal.h
@@ -98,7 +98,7 @@ public:
         : sink_(partition, threshold, suite), journal_(sink_)
     {
     }
-    operator beast::Journal &()
+    operator beast::Journal&()
     {
         return journal_;
     }
```

I'm not sure if this was a bug fix or a bug introduction. I'm calling it a bug
only because from my perspective, I am getting non-determinism even when
following the official install instructions for one major version of
clang-format, and even when those instructions installed the same patch
version, if I'm reading it correctly. If there is another way we can pin an
even more specific version of clang-format to install, or otherwise guarantee
consistent formatting day-to-day, please let me know.

-- 
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/20200519/0b2a5e24/attachment.html>


More information about the llvm-bugs mailing list