Refactor and then enable modernize-use-default-member-init in our clang-tidy job.
tidy: add modernize-use-default-member-init #25108
pull fanquake wants to merge 2 commits into bitcoin:master from fanquake:modernize_use_default_Member_init changing 40 files +59 −88-
fanquake commented at 3:47 PM on May 11, 2022: member
- fanquake added the label Refactoring on May 11, 2022
-
in src/bench/prevector.cpp:14 in de22cd9835 outdated
9 | @@ -10,8 +10,8 @@ 10 | #include <bench/bench.h> 11 | 12 | struct nontrivial_t { 13 | - int x; 14 | - nontrivial_t() :x(-1) {} 15 | + int x{-1}; 16 | + nontrivial_t() {}
PastaPastaPasta commented at 6:08 PM on May 11, 2022:nontrivial_t() = default;in src/bitcoin-cli.cpp:177 in de22cd9835 outdated
173 | @@ -174,10 +174,10 @@ static int AppInitRPC(int argc, char* argv[]) 174 | /** Reply structure for request_done to fill in */ 175 | struct HTTPReply 176 | { 177 | - HTTPReply(): status(0), error(-1) {} 178 | + HTTPReply() {}
PastaPastaPasta commented at 6:09 PM on May 11, 2022:HTTPReply() = default;in src/rpc/blockchain.cpp:1974 in de22cd9835 outdated
1968 | @@ -1969,9 +1969,9 @@ static std::atomic<bool> g_should_abort_scan; 1969 | class CoinsViewScanReserver 1970 | { 1971 | private: 1972 | - bool m_could_reserve; 1973 | + bool m_could_reserve{false}; 1974 | public: 1975 | - explicit CoinsViewScanReserver() : m_could_reserve(false) {} 1976 | + explicit CoinsViewScanReserver() {}
PastaPastaPasta commented at 6:09 PM on May 11, 2022:explicit CoinsViewScanReserver() = default;PastaPastaPasta commented at 6:09 PM on May 11, 2022: contributorwhile you are here, I think it'd make sense to use
= defaultOtherwise, concept ACK
DrahtBot commented at 7:30 AM on May 12, 2022: member<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #25110 (tidy: use modernize-use-raw-string-literal by fanquake)
- #24914 (wallet: Load database records in a particular order by achow101)
- #24676 ([WIP] [kernelheaders 1/n] Cleave LevelDB headers from our header tree by dongcarl)
- #24149 (Signing support for Miniscript Descriptors by darosior)
- #22793 (Simplify BaseSignatureChecker virtual functions and GenericTransactionSignatureChecker constructors by achow101)
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.
fanquake force-pushed on May 12, 2022fanquake force-pushed on May 13, 2022fanquake commented at 11:32 AM on May 13, 2022: memberwhile you are here, I think it'd make sense to use = default
Have done that now.
PastaPastaPasta approvedPastaPastaPasta commented at 3:12 PM on May 13, 2022: contributorutACK, I have reviewed the diff, and all changes make sense. I would recommend changing the title to
refactor: clang-tidy enable/use modernize-use-default-member-init and modernize-use-equals-defaultfanquake force-pushed on May 13, 2022refactor: use C++11 default initializers 7aa40f5563tidy: use modernize-use-default-member-init ac6fbf2c83fanquake force-pushed on May 17, 2022MarcoFalke commented at 5:19 PM on May 18, 2022: memberACK modernize-use-default-member-init
not sure if modernize-use-equals-default provides any value for us, but I guess it doesn't hurt either.
MarcoFalke merged this on May 18, 2022MarcoFalke closed this on May 18, 2022fanquake deleted the branch on May 19, 2022sidhujag referenced this in commit e8b1066341 on May 28, 2022PastaPastaPasta referenced this in commit dda7a65648 on Oct 18, 20228498549767 commented at 10:47 AM on January 24, 2023: noneExelente
fanquake locked this on Jan 24, 2023Labels
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 06:14 UTC
More mirrored repositories can be found on mirror.b10c.me