[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 13 11:04:55 PDT 2020


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

In D71199#2215719 <https://reviews.llvm.org/D71199#2215719>, @baloghadamsoftware wrote:

> Since no better idea cam to my mind, in this version I check whether `modernize-use-default-member-init` is enabled. If it is, then we issue a warning and suggest a fix that uses default member initializer. We also take into account the option for that checker whether we should use brackets or assignment. This checker has no options now. If the other checker is not enabled, we always warn and suggest fix to use constructor member initializer.

While I don't feel awesome about this approach, I don't have a better idea either. Unless @alexfh, @gribozavr2, or one of the other reviewers has concerns, this LGTM. Thank you for your patience while we thought our way through this!


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

https://reviews.llvm.org/D71199



More information about the cfe-commits mailing list