Page MenuHomePhabricator

[clang-tidy] altera-id-dependent-backward-branch: do not mark all variables
Needs ReviewPublic

Authored by yeputons-gh on Sat, Mar 4, 3:32 AM.

Details

Summary

Mark variables/fields as ID-dependent when initializing from ID-dependent
expressions only, not any expressions.

Fixes https://github.com/llvm/llvm-project/issues/52790

Depends on D145304

Diff Detail

Event Timeline

yeputons-gh created this revision.Sat, Mar 4, 3:32 AM
Herald added a project: Restricted Project. · View Herald Transcript
yeputons-gh requested review of this revision.Sat, Mar 4, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptSat, Mar 4, 3:32 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
yeputons-gh edited the summary of this revision. (Show Details)Sat, Mar 4, 3:33 AM

Applied clang-format to the header as well

yeputons-gh added inline comments.Sat, Mar 4, 9:38 AM
clang-tools-extra/test/clang-tidy/checkers/altera/id-dependent-backward-branch.cpp
128

This line previously yielded a false positive. Now it does not. More tests are created in upcoming patches.

yeputons-gh retitled this revision from clang-tidy altera-id-dependent-backward-branch: fix #52790 to [clang-tidy] altera-id-dependent-backward-branch: fix #52790.Sun, Mar 5, 9:44 AM
yeputons-gh retitled this revision from [clang-tidy] altera-id-dependent-backward-branch: fix #52790 to [clang-tidy] altera-id-dependent-backward-branch: do not mark all variables.Sun, Mar 5, 9:45 AM

Rebased on top of the recent main.