Fix clang 23 -Wlifetime-safety errors#106197
Conversation
Fix: - -Wlifetime-safety-dangling-global-moved in `ReplicasReconnector`, - -Wlifetime-safety-dangling-field-moved in `MergeTreeReaderStream` and `TTLTransform` - -Wlifetime-safety-return-stack-addr-moved in `BackupsWorker` (move first, alias later) - -Wunused-but-set-variable for `inside_main` in keeper. - -Wlifetime-safety-use-after-scope-moved in ProfileEvents Disable -Wlifetime-safety-invalidation: too many false positives, it treats mutation of a container captured by reference in a lambda as invalidating the reference to the container variable itself. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Workflow [PR], commit [b9d2d91] Summary: ❌
AI ReviewSummaryThis PR fixes Clang 23 warning cleanup in the warning configuration and in pointer/ownership assignment order for Missing context / blind spots
Final VerdictStatus: ✅ Approve. No code changes requested; merge should still wait for the pending CI jobs that validate the compiler-warning contract. |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 35/38 (92.11%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 2 line(s) · Uncovered code |
We can annotate these cases in a subsequent PR and enable the warnings. I don't mind doing it in 1000 places :) |
There are not too many (AFAFIR around 63), but not sure that it worth it, since looks like it is a bug in the clang analysis |
Fix:
ReplicasReconnector,MergeTreeReaderStreamandTTLTransformBackupsWorker(move first, alias later)inside_mainin keeper.Disable -Wlifetime-safety-invalidation: too many false positives, it treats mutation of a container captured by reference in a lambda as invalidating the reference to the container variable itself.
Changelog category (leave one):