[cfe-commits] clang patch for bug 14021
Nico Weber
thakis at chromium.org
Mon Oct 15 15:44:25 PDT 2012
Test?
On Mon, Oct 15, 2012 at 3:10 PM, Robert Muth <robertm at google.com> wrote:
> This is a fix for: http://llvm.org/bugs/show_bug.cgi?id=14021
>
> diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
> index 42fc84d..d4d0e94 100644
> --- a/lib/Sema/SemaInit.cpp
> +++ b/lib/Sema/SemaInit.cpp
> @@ -3708,8 +3708,14 @@ static void TryUserDefinedConversion(Sema &S,
>
> // Try to complete the type we're converting to.
> if (!S.RequireCompleteType(Kind.getLocation(), DestType, 0)) {
> - DeclContext::lookup_iterator Con, ConEnd;
> - for (llvm::tie(Con, ConEnd) = S.LookupConstructors(DestRecordDecl);
> + DeclContext::lookup_iterator ConOrig, ConEndOrig;
> + llvm::tie(ConOrig, ConEndOrig) = S.LookupConstructors(DestRecordDecl);
> + // The container holding the constructors can under certain conditions
> + // be changed while iterating. To be safe we copy the lookup results
> + // to a new container.
> + SmallVector<NamedDecl*, 8> CopyOfCon(ConOrig, ConEndOrig);
> + for (SmallVector<NamedDecl*, 8>::iterator
> + Con = CopyOfCon.begin(), ConEnd = CopyOfCon.end();
> Con != ConEnd; ++Con) {
> NamedDecl *D = *Con;
> DeclAccessPair FoundDecl = DeclAccessPair::make(D, D->getAccess());
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list