[PATCH] D114995: clang-tidy: improve the 'modernize-use-default-member-init'

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 8 12:31:00 PST 2021


aaron.ballman added reviewers: aaron.ballman, whisperity, alexfh, malcolm.parsons.
aaron.ballman added a comment.
Herald added a subscriber: rnkovacs.

Adding some additional reviewers. At a high level, I think this is a reasonable direction to go, but I wonder if this should be hidden behind a configuration option or not (basically, was there a reason we didn't cover that case originally or was it an oversight/left for future work)?



================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-use-default-member-init.cpp:48-49
 
+struct PositiveNotDefaultInt {
+  PositiveNotDefaultInt(int) : i(7) {}
+  // CHECK-FIXES: PositiveNotDefaultInt(int)  {}
----------------
The "default" here is not about the constructor but about the argument to the constructor, I believe. So I think this should be renamed to `PositiveConstantMemInit` or something like that (similar for the names below).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114995/new/

https://reviews.llvm.org/D114995



More information about the cfe-commits mailing list