aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-05-31 12:44:46 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-05-31 12:44:46 +0000
commitfa6e63a06bf6d6bd10c6dfd38966adf4160bf979 (patch)
tree12aad0d792acf456d809de9f2b03f2697cc8047a /lib/Sema/SemaDecl.cpp
parent8adc227de934e23c72eb8d9abf5c0e3dfffec131 (diff)
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
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp2
1 files changed, 2 insertions, 0 deletions
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