Skip to content

Commit c3061e9

Browse files
committed
[MiscDiagnostics] Look through ABISafe conversions while determining whether access is mutating or not
Otherwise `inout` uses of declarations that require ABI safe conversions are going to be diagnosed as non-mutating. (cherry picked from commit ff5e2dd)
1 parent 5cfb8e8 commit c3061e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Sema/MiscDiagnostics.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4333,6 +4333,9 @@ void VarDeclUsageChecker::markStoredOrInOutExpr(Expr *E, unsigned Flags) {
43334333
if (auto *expr = OpaqueValueMap[OVE])
43344334
return markStoredOrInOutExpr(expr, Flags);
43354335

4336+
if (auto *ABIConv = dyn_cast<ABISafeConversionExpr>(E))
4337+
return markStoredOrInOutExpr(ABIConv->getSubExpr(), Flags);
4338+
43364339
// If we don't know what kind of expression this is, assume it's a reference
43374340
// and mark it as a read.
43384341
E->walk(*this);

0 commit comments

Comments
 (0)