aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/ASTVector.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/clang/AST/ASTVector.h b/include/clang/AST/ASTVector.h
index a23ce87a91..217dfade52 100644
--- a/include/clang/AST/ASTVector.h
+++ b/include/clang/AST/ASTVector.h
@@ -176,6 +176,10 @@ public:
template<typename in_iter>
void append(ASTContext &C, in_iter in_start, in_iter in_end) {
size_type NumInputs = std::distance(in_start, in_end);
+
+ if (NumInputs == 0)
+ return;
+
// Grow allocated space if needed.
if (NumInputs > size_type(this->capacity_ptr()-this->end()))
this->grow(C, this->size()+NumInputs);