This PR:
- fixes the only remained check in headers, i.e.,
modernize-use-default-member-init - forces
clang-tidycheck all headers
Closes bitcoin/bitcoin#26703.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | MarcoFalke |
| Concept ACK | RandyMcMillan |
| Stale ACK | w0xlt |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
concept ack, but it might be good to create one pull/commit for each bugfix. For example, it might be easier to review if there was a separate pull/commit to fix broken std::move.
Could this be done with a scripted-diff script using the clang-tidy -fix-errors command?
Concept ACK
I agree with @MarcoFalke
concept ack, but it might be good to create one pull/commit for each bugfix.
Please review:
Drafting this PR for now.
Rebased and ready for reviewing.
12 | @@ -13,7 +13,7 @@ 13 | 14 | #include <optional> 15 | 16 | -extern RecursiveMutex cs_main; 17 | +extern RecursiveMutex cs_main; // NOLINT(readability-redundant-declaration)
So this is only fixing modernize-use-default-member-init, and no other remaining checks?
Edit: Modulo #26705 (review)
So this is only fixing
modernize-use-default-member-init, and no other remaining checks?Edit: Modulo #26705 (comment)
That's true.
See https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html
Rebased. The PR description has been updated.
review ACK b0e916913cedb8154419ec818bb9094a72fc8379 🍹
<details><summary>Show signature</summary>
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
review ACK b0e916913cedb8154419ec818bb9094a72fc8379 🍹
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUgbsgwAulUHjNHcytUabJBoaqpKSZ+tuqsd7gFyApI1CC7025pswCu+Ph1iCICt
rpOLfGLvKaWkDF54XUANxTSmk4xP9hnfYdRgllcVi7zbRg1I3Tnr3J5zt2L1PYQH
AcZ+p1fIZautxpg1440WHwlbJL3F8e84rQ2WPRJlpFt5gN9LuKKMVVvZpALna669
kMVk2G9995kbpzDzQWPXYl0LC5aDwdeOIui+DUcHKzIYywTpMAHCMk1F4hUF1J6Q
JdJ/X2pjNpxgRhCL2rdzZ47pZMUWfEMLMs0BslbCmg/6OdKa1NrtHCQZ1FOy+T3v
/Y9D+Z1L7Ku9tzQPzADOy8oL410DZtrchANrlUVBoLBz34uWMHgp/jNqvqvy1jzh
2+4bNe+K8srE1E3y5mUvY68ddB6+4rE05mmKyBd9Rycg5XNsKVAsoZasbD0jBX9C
adldbvwYXjOlIxXlllGGDrOB5m7kqHmWTaCN+SzjRyR/1Gy+a6epas/WHkiYHyuC
HkGz+8hB
=QqPj
-----END PGP SIGNATURE-----
</details>
106 | @@ -107,7 +107,7 @@ class Span 107 | 108 | 109 | public: 110 | - constexpr Span() noexcept : m_data(nullptr), m_size(0) {} 111 | + constexpr Span() noexcept : m_data(nullptr) {}
Any reason why nullptr isn't fixed as well?
Yeah, it has been overlooked. The clang-tidy does not complain, though.
I guess it refrains because there are multiple constructors: https://github.com/llvm/llvm-project/blob/78f88082de3627ea04501c83a08f52cf1e60b4f7/clang-tools-extra/test/clang-tidy/checkers/modernize/use-default-member-init.cpp#L56
Fixed in clang-tidy-17, see https://github.com/llvm/llvm-project/commit/fa491fefb0f862b653b196eb61f0e690b0b71460