diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 9bf52156348c..6ddeba99a737 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -189,7 +189,7 @@ public: { return Visit(E->getChosenSubExpr(Info.Ctx)); } bool VisitCastExpr(CastExpr *E) { return Visit(E->getSubExpr()); } bool VisitBinAssign(BinaryOperator *E) { return true; } - bool VisitCompoundAssign(BinaryOperator *E) { return true; } + bool VisitCompoundAssignOperator(BinaryOperator *E) { return true; } bool VisitBinaryOperator(BinaryOperator *E) { return Visit(E->getLHS()) || Visit(E->getRHS()); } bool VisitUnaryPreInc(UnaryOperator *E) { return true; } diff --git a/clang/test/CodeGen/object-size.c b/clang/test/CodeGen/object-size.c index 27e24ac12014..db6d948d83e2 100644 --- a/clang/test/CodeGen/object-size.c +++ b/clang/test/CodeGen/object-size.c @@ -118,3 +118,9 @@ void test15() { // CHECK: call ___inline_strcpy_chk strcpy(gp--, "Hi there"); } + +void test16() { + // CHECK-NOT: call ___strcpy_chk + // CHECK: call ___inline_strcpy_chk + strcpy(gp += 1, "Hi there"); +}