@@ -9202,17 +9202,17 @@ Sema::CheckAssignmentConstraints(QualType LHSType, ExprResult &RHS,
92029202 // __builtin_counted_by_ref cannot be assigned to a variable, used in
92039203 // function call, or in a return.
92049204 auto FindBuiltinCountedByRefExpr = [&](Expr *E) -> CallExpr * {
9205- struct BuiltinCountedByRefVisitor
9206- : public RecursiveASTVisitor<BuiltinCountedByRefVisitor> {
9205+ struct BuiltinCountedByRefVisitor : DynamicRecursiveASTVisitor {
92079206 CallExpr *TheCall = nullptr;
9208- bool VisitCallExpr(CallExpr *CE) {
9207+ bool VisitCallExpr(CallExpr *CE) override {
92099208 if (CE->getBuiltinCallee() == Builtin::BI__builtin_counted_by_ref) {
92109209 TheCall = CE;
92119210 return false;
92129211 }
92139212 return true;
92149213 }
9215- bool VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *UE) {
9214+ bool
9215+ VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *UE) override {
92169216 // A UnaryExprOrTypeTraitExpr---e.g. sizeof, __alignof, etc.---isn't
92179217 // the same as a CallExpr, so if we find a __builtin_counted_by_ref()
92189218 // call in one, ignore it.
@@ -13783,26 +13783,25 @@ QualType Sema::CheckAssignmentOperands(Expr *LHSExpr, ExprResult &RHS,
1378313783 // subscript on the LHS.
1378413784 int DiagOption = -1;
1378513785 auto FindInvalidUseOfBoundsSafetyCounter = [&](Expr *E) -> CallExpr * {
13786- struct BuiltinCountedByRefVisitor
13787- : public RecursiveASTVisitor<BuiltinCountedByRefVisitor> {
13786+ struct BuiltinCountedByRefVisitor : DynamicRecursiveASTVisitor {
1378813787 CallExpr *CE = nullptr;
1378913788 bool InvalidUse = false;
1379013789 int Option = -1;
1379113790
13792- bool VisitCallExpr(CallExpr *E) {
13791+ bool VisitCallExpr(CallExpr *E) override {
1379313792 if (E->getBuiltinCallee() == Builtin::BI__builtin_counted_by_ref) {
1379413793 CE = E;
1379513794 return false;
1379613795 }
1379713796 return true;
1379813797 }
1379913798
13800- bool VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
13799+ bool VisitArraySubscriptExpr(ArraySubscriptExpr *E) override {
1380113800 InvalidUse = true;
1380213801 Option = 0; // report 'array expression' in diagnostic.
1380313802 return true;
1380413803 }
13805- bool VisitBinaryOperator(BinaryOperator *E) {
13804+ bool VisitBinaryOperator(BinaryOperator *E) override {
1380613805 InvalidUse = true;
1380713806 Option = 1; // report 'binary expression' in diagnostic.
1380813807 return true;
0 commit comments