Skip to content

Commit 964ba73

Browse files
committed
[Sema] Inherit ExprAvailabilityWalker from BaseDiagnosticWalker
Simplifies things a tiny amount, and ensures we don't attempt to walk into non-PatternBindingDecls, same as other MiscDiagnostic passes. I don't think this currently makes a difference since I don't believe we have any interesting cases where a Decl is nested in an Expr without an intermediate Stmt, but it's the right thing to do regardless.
1 parent 6e09a4e commit 964ba73

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3561,7 +3561,7 @@ bool diagnoseExplicitUnavailability(
35613561
}
35623562

35633563
namespace {
3564-
class ExprAvailabilityWalker : public ASTWalker {
3564+
class ExprAvailabilityWalker : public BaseDiagnosticWalker {
35653565
/// Models how member references will translate to accessor usage. This is
35663566
/// used to diagnose the availability of individual accessors that may be
35673567
/// called by the expression being checked.
@@ -3596,11 +3596,6 @@ class ExprAvailabilityWalker : public ASTWalker {
35963596
explicit ExprAvailabilityWalker(const ExportContext &Where)
35973597
: Context(Where.getDeclContext()->getASTContext()), Where(Where) {}
35983598

3599-
MacroWalking getMacroWalkingBehavior() const override {
3600-
// Expanded source should be type checked and diagnosed separately.
3601-
return MacroWalking::Arguments;
3602-
}
3603-
36043599
PreWalkAction walkToArgumentPre(const Argument &Arg) override {
36053600
// Arguments should be walked in their own member access context which
36063601
// starts out read-only by default.

0 commit comments

Comments
 (0)