On Sat, Jul 13, 2013 at 12:23 PM, David Blaikie <[email protected]> wrote: > > Author: dblaikie > Date: Sat Jul 13 14:23:35 2013 > New Revision: 186257 > > URL: http://llvm.org/viewvc/llvm-project?rev=186257&view=rev > Log: > Revert "Revert "PR16540: ASTVector::insert(Context, Iter, Element) doesn't > compile"" > > This reverts commit b18b043a5a37f76803d89467e46bcac286c0ecae.
Sorry, that's r186255, which reverted r186253. > > Reapply with fix for the configure+make build (missing include of > ASTContext.h). > > Added: > cfe/trunk/unittests/AST/ASTVectorTest.cpp > Modified: > cfe/trunk/include/clang/AST/ASTVector.h > cfe/trunk/unittests/AST/CMakeLists.txt > > Modified: cfe/trunk/include/clang/AST/ASTVector.h > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTVector.h?rev=186257&r1=186256&r2=186257&view=diff > ============================================================================== > --- cfe/trunk/include/clang/AST/ASTVector.h (original) > +++ cfe/trunk/include/clang/AST/ASTVector.h Sat Jul 13 14:23:35 2013 > @@ -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); > + push_back(Elt, C); > return this->end()-1; > } > > - if (this->EndX < this->CapacityX) { > + if (this->End < this->Capacity) { > Retry: > new (this->end()) T(this->back()); > this->setEnd(this->end()+1); > > Added: cfe/trunk/unittests/AST/ASTVectorTest.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/ASTVectorTest.cpp?rev=186257&view=auto > ============================================================================== > --- cfe/trunk/unittests/AST/ASTVectorTest.cpp (added) > +++ cfe/trunk/unittests/AST/ASTVectorTest.cpp Sat Jul 13 14:23:35 2013 > @@ -0,0 +1,24 @@ > +//===- 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/ASTContext.h" > +#include "clang/AST/ASTVector.h" > + > +using namespace clang; > + > +LLVM_ATTRIBUTE_UNUSED void CompileTest() { > + ASTContext *C = 0; > + ASTVector<int> V; > + V.insert(*C, V.begin(), 0); > +} > > Modified: cfe/trunk/unittests/AST/CMakeLists.txt > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/CMakeLists.txt?rev=186257&r1=186256&r2=186257&view=diff > ============================================================================== > --- cfe/trunk/unittests/AST/CMakeLists.txt (original) > +++ cfe/trunk/unittests/AST/CMakeLists.txt Sat Jul 13 14:23:35 2013 > @@ -1,6 +1,7 @@ > add_clang_unittest(ASTTests > ASTContextParentMapTest.cpp > ASTTypeTraitsTest.cpp > + ASTVectorTest.cpp > CommentLexer.cpp > CommentParser.cpp > DeclPrinterTest.cpp > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
