This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Fix a -Warc-repeated-use-of-weak false-positive by only calling CheckPlaceholderExpr once
ClosedPublic

Authored by erik.pilkington on Sep 3 2020, 10:59 AM.

Details

Summary

Previously, this code discarded the result of CheckPlaceholderExpr for non-matrix subexpressions. Not only is this wasteful, but it was creating a Warc-repeated-use-of-weak false-positive on the attached testcase, since the discarded expression was still registered as a use of the weak property. (This was introduced in D76791)

rdar://66162246

Diff Detail

Event Timeline

erik.pilkington requested review of this revision.Sep 3 2020, 10:59 AM
rjmccall accepted this revision.Sep 3 2020, 1:16 PM

LGTM

This revision is now accepted and ready to land.Sep 3 2020, 1:16 PM
fhahn accepted this revision.Sep 3 2020, 1:16 PM

LGTM, thanks for addressing this! Please wait a bit with committing, in case there are additional comments.

clang/lib/Sema/SemaExpr.cpp
4598

I think it would be good to split the comment into 2. The case below is base is a MatrixSubscriptExpr, and further down we handle base is a matrix type.

Herald added a project: Restricted Project. · View Herald TranscriptSep 3 2020, 1:57 PM