diff --git a/clang/include/clang/AST/StmtObjC.h b/clang/include/clang/AST/StmtObjC.h index 03bc61f54cdf5..af95d65fa2a3c 100644 --- a/clang/include/clang/AST/StmtObjC.h +++ b/clang/include/clang/AST/StmtObjC.h @@ -166,7 +166,8 @@ class ObjCAtTryStmt final : public Stmt, private llvm::TrailingObjects { friend TrailingObjects; - size_t numTrailingObjects(OverloadToken) const { + + size_t numTrailingStatements() const { return 1 + NumCatchStmts + HasFinally; } @@ -185,8 +186,8 @@ class ObjCAtTryStmt final /// The order of the statements in memory follows the order in the source, /// with the \@try body first, followed by the \@catch statements (if any) /// and, finally, the \@finally (if it exists). - Stmt **getStmts() { return getTrailingObjects(); } - Stmt *const *getStmts() const { return getTrailingObjects(); } + Stmt **getStmts() { return getTrailingObjects(); } + Stmt *const *getStmts() const { return getTrailingObjects(); } ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt, Stmt **CatchStmts, unsigned NumCatchStmts, @@ -262,8 +263,7 @@ class ObjCAtTryStmt final } child_range children() { - return child_range( - getStmts(), getStmts() + numTrailingObjects(OverloadToken())); + return child_range(getStmts(), getStmts() + numTrailingStatements()); } const_child_range children() const {