From fa6e63a06bf6d6bd10c6dfd38966adf4160bf979 Mon Sep 17 00:00:00 2001 From: Francois Pichet Date: Tue, 31 May 2011 12:44:46 +0000 Subject: [PATCH] Recreate the DeclContext before adding the implicit friend forward declaration. This should fix the asserting buildbot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132333 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDecl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 878c21776d..7c8d1cfbf3 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6657,6 +6657,8 @@ void Sema::InjectMicrosoftFriendForwardDeclaration(unsigned TagSpec, TagTypeKind Kind = TypeWithKeyword::getTagTypeKindForTypeSpec(TagSpec); TagDecl *New = CXXRecordDecl::Create(Context, Kind, ContextToAdd, KWLoc, NameLoc, Name, 0); + // Recreate the DeclContext. + ContextRAII SavedContext(*this, ContextToAdd); if (getCurScope()->getFnParent()) PushOnScopeChains(New, getScopeForContext(ContextToAdd), true); else -- 2.50.1