vadikmironov wrote:
> So to summarize, the warning is incorrect and can be safely ignored, but if
> one were to run --fix, it would cause code that previously compiled to no
> longer compile. Would that be a correct assessment?
>
> How common is this false positive warning? Is this something that could be
> hit easily/often?
>
> @vbvictor and @zeyi2 what do you think about porting this change to
> `release/23.x`?
Yes, as long as there is no `WarningsAsErrors` or `readability-*` glob which
enables the check. How often depends on the code style. As far as I can tell,
it happens to an aggregate with default member initializers, written as an
empty `{}` before another element: an argument `f(S{}, 1)`, or a default
argument `S opts = {}, int x = 0`.
I could only find two reports (#220222, and #223646) on 23.1.1 and my project
hit it too. When checking LLVM own code, it's not too often this pattern is
used. Scanning clang-tidy sources this is reported just in two places, both in
`clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h`
(`TrackingOptions Opts = {},`).
https://github.com/llvm/llvm-project/pull/236390
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits