From 0e167f7368fcf4d2527b1ee94a8e02c4c5698581 Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Fri, 31 Aug 2012 17:28:09 +0000 Subject: [PATCH] Fixed invalid iterators. Since the iterator is invalidated after the erase() call, we need to replace it with the new one returned. This was triggering an assert under MSVC 2012 and making all the ARCMT/ tests fail. llvm-svn: 163007 --- clang/lib/ARCMigrate/ARCMT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/ARCMigrate/ARCMT.cpp b/clang/lib/ARCMigrate/ARCMT.cpp index 14e13ba58cfa..9c4c2f2df684 100644 --- a/clang/lib/ARCMigrate/ARCMT.cpp +++ b/clang/lib/ARCMigrate/ARCMT.cpp @@ -42,7 +42,7 @@ bool CapturedDiagList::clearDiagnostic(ArrayRef IDs, while (I != List.end() && I->getLevel() == DiagnosticsEngine::Note) ++I; // Clear the diagnostic and any notes following it. - List.erase(eraseS, I); + I = List.erase(eraseS, I); continue; }