From 65732a200987cb4b007fbb3015a8bae175ddb832 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sat, 13 Jul 2013 18:54:56 +0000 Subject: [PATCH] Revert "PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile" This reverts commit r186253. This is failing to link under Configure+Make on the buildbots for reasons I don't immediately understand. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186255 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/ASTVector.h | 4 ++-- unittests/AST/ASTVectorTest.cpp | 26 -------------------------- unittests/AST/CMakeLists.txt | 1 - 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 unittests/AST/ASTVectorTest.cpp diff --git a/include/clang/AST/ASTVector.h b/include/clang/AST/ASTVector.h index 0d4b3c4bb7..669e50dbeb 100644 --- a/include/clang/AST/ASTVector.h +++ b/include/clang/AST/ASTVector.h @@ -216,11 +216,11 @@ public: iterator insert(ASTContext &C, iterator I, const T &Elt) { if (I == this->end()) { // Important special case for empty vector. - push_back(Elt, C); + push_back(Elt); return this->end()-1; } - if (this->End < this->Capacity) { + if (this->EndX < this->CapacityX) { Retry: new (this->end()) T(this->back()); this->setEnd(this->end()+1); diff --git a/unittests/AST/ASTVectorTest.cpp b/unittests/AST/ASTVectorTest.cpp deleted file mode 100644 index f8527432d2..0000000000 --- a/unittests/AST/ASTVectorTest.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===- unittests/AST/DeclTest.cpp --- Declaration tests -------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Unit tests for the ASTVector container. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Support/Compiler.h" -#include "clang/AST/ASTVector.h" -#include "clang/Basic/TargetInfo.h" -#include "clang/Frontend/CompilerInstance.h" -#include "gtest/gtest.h" - -using namespace clang; - -LLVM_ATTRIBUTE_UNUSED void CompileTest() { - ASTContext *C = 0; - ASTVector V; - V.insert(*C, V.begin(), 0); -} diff --git a/unittests/AST/CMakeLists.txt b/unittests/AST/CMakeLists.txt index 70f86d3c73..c414ae3b23 100644 --- a/unittests/AST/CMakeLists.txt +++ b/unittests/AST/CMakeLists.txt @@ -1,7 +1,6 @@ add_clang_unittest(ASTTests ASTContextParentMapTest.cpp ASTTypeTraitsTest.cpp - ASTVectorTest.cpp CommentLexer.cpp CommentParser.cpp DeclPrinterTest.cpp -- 2.40.0