This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Allow bugprone-unchecked-optional-access to handle calls to `std::forward`
ClosedPublic

Authored by AMS21 on Apr 1 2023, 12:14 PM.

Details

Summary

The check now understands that calling std::forward
will not modify the underlying optional value.

This fixes llvm#59705

Diff Detail

Event Timeline

AMS21 created this revision.Apr 1 2023, 12:14 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: xazax.hun. · View Herald Transcript
AMS21 requested review of this revision.Apr 1 2023, 12:14 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 1 2023, 12:14 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
PiotrZSL accepted this revision.Apr 3 2023, 11:43 AM

LGTM

clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
589–591
if (LocArg == nullptr)
    return;
This revision is now accepted and ready to land.Apr 3 2023, 11:43 AM
AMS21 updated this revision to Diff 510698.Apr 3 2023, 11:18 PM
AMS21 marked an inline comment as done.

Remove unneccesary braces

AMS21 added a comment.Apr 3 2023, 11:18 PM

Now I would kindly as for someone to commit this on my behalf.

This revision was landed with ongoing or failed builds.Apr 4 2023, 12:25 AM
This revision was automatically updated to reflect the committed changes.