This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by yeputons-gh on Mar 4 2023, 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.Mar 4 2023, 3:32 AM
Herald added a project: Restricted Project. · View Herald Transcript
yeputons-gh requested review of this revision.Mar 4 2023, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2023, 3:32 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
yeputons-gh edited the summary of this revision. (Show Details)Mar 4 2023, 3:33 AM

Applied clang-format to the header as well

yeputons-gh added inline comments.Mar 4 2023, 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.Mar 5 2023, 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.Mar 5 2023, 9:45 AM

Rebased on top of the recent main.