This revision was automatically updated to reflect the committed changes.
Closed by commit rL284742: [clang-tidy] Add check
'readability-redundant-member-init' (authored by malcolm.parsons).
Changed prior to commit:
https://reviews.llvm.org/D24339?vs=74769&id=75311#toc
Repository:
rL LLVM
h
malcolm.parsons updated this revision to Diff 74769.
malcolm.parsons added a comment.
Use ignoringImplicit
https://reviews.llvm.org/D24339
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityTidyModule.cpp
clang-tidy/readability/RedundantMemberInitCheck.cpp
cl
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM!
https://reviews.llvm.org/D24339
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman
malcolm.parsons updated this revision to Diff 73479.
malcolm.parsons added a comment.
Add test for initializing a union member.
Add test for multiple inheritance.
https://reviews.llvm.org/D24339
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityTidyModule.cpp
malcolm.parsons added inline comments.
> aaron.ballman wrote in readability-redundant-member-init.cpp:162
> Missing a test for `union` member initializers. Also, a test that multiple
> inheritance doesn't cause a fixit malfunction would be nice.
Note that all the fixits malfunction until https:
aaron.ballman added inline comments.
> readability-redundant-member-init.cpp:162
> + const S f;
> +};
Missing a test for `union` member initializers. Also, a test that multiple
inheritance doesn't cause a fixit malfunction would be nice.
https://reviews.llvm.org/D24339
malcolm.parsons updated this revision to Diff 73260.
malcolm.parsons added a comment.
Herald added a subscriber: modocache.
Don't warn for trivially default constructable members
https://reviews.llvm.org/D24339
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityT
malcolm.parsons updated this revision to Diff 72181.
malcolm.parsons added a comment.
Don't remove init of const members.
Do remove calls to constructors that introduce cleanups.
https://reviews.llvm.org/D24339
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityT
malcolm.parsons updated this revision to Diff 71802.
malcolm.parsons added a comment.
Handle delegating and base class constructors
https://reviews.llvm.org/D24339
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityTidyModule.cpp
clang-tidy/readability/Redundan
malcolm.parsons updated this revision to Diff 71622.
malcolm.parsons added a comment.
Herald added a subscriber: mgorny.
Handle unions and templated classes.
Add FixItHints (depends on https://reviews.llvm.org/D24572).
https://reviews.llvm.org/D24339
Files:
clang-tidy/readability/CMakeLists.t
alexfh added a comment.
In https://reviews.llvm.org/D24339#537488, @malcolm.parsons wrote:
> How do I add FixIt hints?
> They should be simple removals, but how do I decide whether to remove the
> following comma, preceding comma or preceding colon?
Just remove the entry and leave the comma a
malcolm.parsons marked 15 inline comments as done.
Comment at: clang-tidy/readability/RedundantMemberInitCheck.cpp:34
@@ +33,3 @@
+
+ if (Construct->getNumArgs() == 0 ||
+ Construct->getArg(0)->isDefaultArgument()) {
Other forms of initialization are not CXX
malcolm.parsons updated this revision to Diff 70797.
malcolm.parsons added a comment.
Improve comments
Improve doc
Add tests
Simplify implementation
https://reviews.llvm.org/D24339
Files:
clang-tidy/readability/CMakeLists.txt
clang-tidy/readability/ReadabilityTidyModule.cpp
clang-tidy/rea
malcolm.parsons added a comment.
How do I add FixIt hints?
They should be simple removals, but how do I decide whether to remove the
following comma, preceding comma or preceding colon?
Comment at: clang-tidy/readability/RedundantMemberInitCheck.cpp:33
@@ +32,3 @@
+ const auto
aaron.ballman added inline comments.
Comment at: clang-tidy/readability/RedundantMemberInitCheck.cpp:34
@@ +33,3 @@
+ const auto *Construct =
Result.Nodes.getNodeAs("construct");
+ const auto arguments = Construct->arguments();
+
sbenza wrote:
> Prazek wrote:
>
sbenza added inline comments.
Comment at: clang-tidy/readability/RedundantMemberInitCheck.cpp:33
@@ +32,3 @@
+ const auto *Init = Result.Nodes.getNodeAs("init");
+ const auto *Construct =
Result.Nodes.getNodeAs("construct");
+ const auto arguments = Construct->arguments();
---
Eugene.Zelenko added inline comments.
Comment at: clang-tidy/readability/RedundantMemberInitCheck.cpp:36
@@ +35,3 @@
+
+ using std::begin;
+ using std::end;
begin() and end() are not used extensively. Why not to use std::?
Repository:
rL LLVM
https://review
Prazek added inline comments.
Comment at: clang-tidy/readability/RedundantMemberInitCheck.cpp:34
@@ +33,3 @@
+ const auto *Construct =
Result.Nodes.getNodeAs("construct");
+ const auto arguments = Construct->arguments();
+
Arguments (upper case)
Repository:
Eugene.Zelenko added a subscriber: Eugene.Zelenko.
Eugene.Zelenko added a comment.
I think will be good idea to add cases when member is initialized in
declaration and constructor, with same and different values.
Comment at: docs/clang-tidy/checks/readability-redundant-member-i
19 matches
Mail list logo