Skip to content

Commit ff5e2dd

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.
1 parent 8c8d573 commit ff5e2dd

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
@@ -4351,6 +4351,9 @@ void VarDeclUsageChecker::markStoredOrInOutExpr(Expr *E, unsigned Flags) {
43514351
if (auto *expr = OpaqueValueMap[OVE])
43524352
return markStoredOrInOutExpr(expr, Flags);
43534353

4354+
if (auto *ABIConv = dyn_cast<ABISafeConversionExpr>(E))
4355+
return markStoredOrInOutExpr(ABIConv->getSubExpr(), Flags);
4356+
43544357
// If we don't know what kind of expression this is, assume it's a reference
43554358
// and mark it as a read.
43564359
E->walk(*this);

0 commit comments

Comments
 (0)