@@ -3860,10 +3860,9 @@ class ExprAvailabilityWalker : public BaseDiagnosticWalker {
3860
3860
DeclAvailabilityFlags flags = std::nullopt) const ;
3861
3861
3862
3862
private:
3863
- bool diagnoseIncDecRemoval (const ValueDecl *D, SourceRange R,
3864
- const AvailableAttr *Attr) const ;
3863
+ bool diagnoseIncDecRemoval (const ValueDecl *D, SourceRange R) const ;
3865
3864
bool diagnoseMemoryLayoutMigration (const ValueDecl *D, SourceRange R,
3866
- const AvailableAttr *Attr ,
3865
+ SemanticAvailableAttr ,
3867
3866
const ApplyExpr *call) const ;
3868
3867
3869
3868
// / Walks up from a potential callee to the enclosing ApplyExpr.
@@ -4099,11 +4098,10 @@ bool ExprAvailabilityWalker::diagnoseDeclRefAvailability(
4099
4098
return false ;
4100
4099
4101
4100
if (auto attr = D->getUnavailableAttr ()) {
4102
- auto parsedAttr = attr->getParsedAttr ();
4103
- if (diagnoseIncDecRemoval (D, R, parsedAttr))
4101
+ if (diagnoseIncDecRemoval (D, R))
4104
4102
return true ;
4105
4103
if (isa_and_nonnull<ApplyExpr>(call) &&
4106
- diagnoseMemoryLayoutMigration (D, R, parsedAttr , cast<ApplyExpr>(call)))
4104
+ diagnoseMemoryLayoutMigration (D, R, *attr , cast<ApplyExpr>(call)))
4107
4105
return true ;
4108
4106
}
4109
4107
@@ -4363,8 +4361,7 @@ static bool isIntegerOrFloatingPointType(Type ty) {
4363
4361
// / If this is a call to an unavailable ++ / -- operator, try to diagnose it
4364
4362
// / with a fixit hint and return true. If not, or if we fail, return false.
4365
4363
bool
4366
- ExprAvailabilityWalker::diagnoseIncDecRemoval (const ValueDecl *D, SourceRange R,
4367
- const AvailableAttr *Attr) const {
4364
+ ExprAvailabilityWalker::diagnoseIncDecRemoval (const ValueDecl *D, SourceRange R) const {
4368
4365
// We can only produce a fixit if we're talking about ++ or --.
4369
4366
bool isInc = D->getBaseName () == " ++" ;
4370
4367
if (!isInc && D->getBaseName () != " --" )
@@ -4423,7 +4420,7 @@ ExprAvailabilityWalker::diagnoseIncDecRemoval(const ValueDecl *D, SourceRange R,
4423
4420
bool
4424
4421
ExprAvailabilityWalker::diagnoseMemoryLayoutMigration (const ValueDecl *D,
4425
4422
SourceRange R,
4426
- const AvailableAttr * Attr,
4423
+ SemanticAvailableAttr Attr,
4427
4424
const ApplyExpr *call) const {
4428
4425
4429
4426
if (!D->getModuleContext ()->isStdlibModule ())
@@ -4446,7 +4443,7 @@ ExprAvailabilityWalker::diagnoseMemoryLayoutMigration(const ValueDecl *D,
4446
4443
if (!subject)
4447
4444
return false ;
4448
4445
4449
- EncodedDiagnosticMessage EncodedMessage (Attr-> Message );
4446
+ EncodedDiagnosticMessage EncodedMessage (Attr. getMessage () );
4450
4447
auto diag =
4451
4448
Context.Diags .diagnose (
4452
4449
R.Start , diag::availability_decl_unavailable, D, true , " " ,
0 commit comments