From 188bfd26a871d5234614d20d406cb80b686a556f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 23 Jul 2013 11:02:16 +0000 Subject: [PATCH] Fix the build in c++03 mode. llvm-svn: 186935 --- llvm/tools/llvm-ar/llvm-ar.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp index db87f76..116143e 100644 --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp @@ -643,7 +643,7 @@ static void writeSymbolTable( unsigned StartOffset = 0; unsigned MemberNum = 0; std::vector SymNames; - std::vector > DeleteIt; + std::vector DeleteIt; for (ArrayRef::iterator I = Members.begin(), E = Members.end(); I != E; ++I, ++MemberNum) { @@ -665,7 +665,7 @@ static void writeSymbolTable( } if (!Obj) continue; - DeleteIt.push_back(OwningPtr(Obj)); + DeleteIt.push_back(Obj); if (!StartOffset) { printMemberHeader(Out, "", sys::TimeValue::now(), 0, 0, 0, 0); StartOffset = Out.tell(); @@ -698,6 +698,13 @@ static void writeSymbolTable( Out << '\0'; } + for (std::vector::iterator I = DeleteIt.begin(), + E = DeleteIt.end(); + I != E; ++I) { + object::ObjectFile *O = *I; + delete O; + } + if (StartOffset == 0) return; -- 2.7.4