[clang-tools-extra] [clang-tidy] The first PR our of many PRs for the "Initialized Class Members" check. (PR #65189)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 8 12:45:58 PDT 2023


https://github.com/PiotrZSL requested changes to this pull request.

To be honest you still didn't clarify how this check is different from an exist ones.
Entire section "Regarding the checker specifications (especially as they compare the cppcoreguidelines-pro-type-member-init):" says only "there are some requirements and plans somewere" but does not say what actually.

The only information about this check comes from examples that you put.
And I see there 2 cases:
1. Handling default constructors - this should be handled in exist check
2. Forcing initialization for POD types - this should be actually separate check or separate option to exist one.

Except above I still don't see any reason why this check should exist in this form.
Name of check suggest class members, but then example show POD structs.

Work more on documentation, "This checker is different from ProTypeMemberInitCheck in that this checker
attempts to eliminate UUMs as a bug class, at the expense of false
positives." says nothing, ProTypeMemberInitCheck also "attempts to eliminate UUMs"...

Thing is that you still got big todo list, and things like initialization by using methods, order of initialization and at the end you still going to end up with bunch of "if-else", not even mentioning needed configuration to exclude some types or some scenarios.

Start with a list of requirements, then we can thing if that should be new check, extended exist check, or multiple checks. For me would be sufficient to add "IncludeTriviallyDefaultConstructible" option to exist check.

https://github.com/llvm/llvm-project/pull/65189


More information about the cfe-commits mailing list