-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress readability-redundant-member-init #4538
Suppress readability-redundant-member-init #4538
Conversation
.clang-tidy
Outdated
@@ -46,6 +46,7 @@ Checks: | |||
-readability-function-cognitive-complexity, -readability-else-after-return, | |||
-readability-identifier-length, -readability-implicit-bool-conversion, | |||
-readability-magic-numbers, -readability-make-member-function-const, | |||
-readability-redundant-member-init, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the other PR, to document why we're doing this, can you add a note above like:
# - readability-redundant-member-init hinders us from setting initializers to
# silence -Wmissing-designated-field-initializers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, done and I rebased on top of #4540, so it should land first.
61fa456
to
0890154
Compare
Head branch was pushed to by a user without write access
f451a8f
to
ba58f26
Compare
This initializes the DriverResult::per_file_success field explicitly with `= {}` in order to encode that DriverResult can be constucted via aggregate initialization while omitting the per_file_success field. This prevents -Wmissing-designated-field-initializers from firing in newer clang versions when constructing DriverResult like: ``` return {.success = false}; ``` Newer clang-tidy warns that the `= {}` is redundant however it is not, as its marking which fields need to be explicitly initialized. So we suppress it.
Head branch was pushed to by a user without write access
ba58f26
to
92f2e84
Compare
Rebased, PTAL |
bump, needs re-merge approval after rebase |
This initializes the DriverResult::per_file_success field explicitly with
= {}
in order to encode that DriverResult can be constucted via aggregate initialization while omitting the per_file_success field. This prevents -Wmissing-designated-field-initializers from firing in newer clang versions when constructing DriverResult like:Newer clang-tidy warns that the
= {}
is redundant however it is not, as its marking which fields need to be explicitly initialized. So we suppress it.