From: Joao Matos Date: Fri, 31 Aug 2012 17:28:09 +0000 (+0000) Subject: Fixed invalid iterators. Since the iterator is invalidated after the erase() call... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4d90e14841e1e2d94701f65ad3f23a223fdaaca;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163007 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ARCMigrate/ARCMT.cpp b/lib/ARCMigrate/ARCMT.cpp index 14e13ba58c..9c4c2f2df6 100644 --- a/lib/ARCMigrate/ARCMT.cpp +++ b/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; }