aaron.ballman added a comment.

In D71199#1775083 <https://reviews.llvm.org/D71199#1775083>, @whisperity wrote:

> Can you refresh my memory on whether a rule for "if init expr is constant, 
> initialise in class body instead" exists for init list members? If so, this 
> will be a funny "two pass needed to fix" kind of check.


This worries me as well -- we already have checks that prefer doing an in-class 
initialization to using a constructor member initialization list. How should 
this check interact with `modernize-use-default-member-init`?



================
Comment at: 
clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp:91
+    CheckFactories.registerCheck<PreferInitializationListCheck>(
+        "readability-prefer-initialization-list");
     CheckFactories.registerCheck<RedundantAccessSpecifiersCheck>(
----------------
I have a concern with the name using `initialization-list` -- that sounds a lot 
like the check is going to prefer `{42}` to `= 42`. Perhaps the name should be 
`prefer-ctor-member-initialization` or something along those lines?


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

https://reviews.llvm.org/D71199



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to