summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-03-12 01:19:31 +0000
committerJohn McCall <rjmccall@apple.com>2010-03-12 01:19:31 +0000
commit16927f6274015cfada7eaed7bf3b92ec912bf674 (patch)
treec99929f372ca4ed68912d4e5aab2a8b2537c6f11 /clang/lib/AST
parent90e2fc2fb396ae96da28b06fdd0de37ddda85f30 (diff)
downloadbcm5719-llvm-16927f6274015cfada7eaed7bf3b92ec912bf674.tar.gz
bcm5719-llvm-16927f6274015cfada7eaed7bf3b92ec912bf674.zip
Implement basic support for friend types and functions in non-dependent
contexts. llvm-svn: 98321
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/DeclCXX.cpp2
-rw-r--r--clang/lib/AST/DeclFriend.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index 72b7f49dff0..cc743200b12 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/lib/AST/DeclCXX.cpp
@@ -33,7 +33,7 @@ CXXRecordDecl::DefinitionData::DefinitionData(CXXRecordDecl *D)
HasTrivialCopyConstructor(true), HasTrivialCopyAssignment(true),
HasTrivialDestructor(true), ComputedVisibleConversions(false),
Bases(0), NumBases(0), VBases(0), NumVBases(0),
- Definition(D) {
+ Definition(D), FirstFriend(0) {
}
CXXRecordDecl::CXXRecordDecl(Kind K, TagKind TK, DeclContext *DC,
diff --git a/clang/lib/AST/DeclFriend.cpp b/clang/lib/AST/DeclFriend.cpp
index 8c7cadfbf74..ab3552db28e 100644
--- a/clang/lib/AST/DeclFriend.cpp
+++ b/clang/lib/AST/DeclFriend.cpp
@@ -35,5 +35,7 @@ FriendDecl *FriendDecl::Create(ASTContext &C, DeclContext *DC,
}
#endif
- return new (C) FriendDecl(DC, L, Friend, FriendL);
+ FriendDecl *FD = new (C) FriendDecl(DC, L, Friend, FriendL);
+ cast<CXXRecordDecl>(DC)->pushFriendDecl(FD);
+ return FD;
}
OpenPOWER on IntegriCloud