This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Initialize boolean variables with 'false' in cppcoreguidelines-init-variables' fix-it
ClosedPublic

Authored by SimplyDanny on Jul 9 2022, 4:35 AM.

Details

Summary

In case of a variable with a built-in boolean type, false is a better fit to default-initialize it.

Diff Detail

Event Timeline

SimplyDanny created this revision.Jul 9 2022, 4:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2022, 4:35 AM
SimplyDanny requested review of this revision.Jul 9 2022, 4:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2022, 4:35 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

This is a potential fix for this issue.

Can you add a line to release notes about this fix then LGTM

njames93 accepted this revision.Jul 9 2022, 4:59 AM
This revision is now accepted and ready to land.Jul 9 2022, 4:59 AM

Can you add a line to release notes about this fix then LGTM

Sure. Thank you for the fast review!

njames93 added inline comments.Jul 9 2022, 6:03 AM
clang-tools-extra/docs/ReleaseNotes.rst
188

It should live here instead.

250–253

Sorry I should've mentioned, we keep this list in alphabetical order(for the names of the checks).
Can you push a patch to move this into its correct place(no need for a review and commit as NFC)

SimplyDanny marked an inline comment as done.Jul 9 2022, 6:48 AM
SimplyDanny added inline comments.
clang-tools-extra/docs/ReleaseNotes.rst
250–253

Ah sorry. I could have noticed that. Fixed in this commit.