aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/DeclFriend.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/DeclFriend.h')
-rw-r--r--include/clang/AST/DeclFriend.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/clang/AST/DeclFriend.h b/include/clang/AST/DeclFriend.h
index 10befe0831..20d6da19b8 100644
--- a/include/clang/AST/DeclFriend.h
+++ b/include/clang/AST/DeclFriend.h
@@ -43,7 +43,7 @@ private:
FriendUnion Friend;
// A pointer to the next friend in the sequence.
- FriendDecl *NextFriend;
+ LazyDeclPtr NextFriend;
// Location of the 'friend' specifier.
SourceLocation FriendLoc;
@@ -60,14 +60,19 @@ private:
SourceLocation FriendL)
: Decl(Decl::Friend, DC, L),
Friend(Friend),
- NextFriend(0),
+ NextFriend(),
FriendLoc(FriendL),
UnsupportedFriend(false) {
}
explicit FriendDecl(EmptyShell Empty)
- : Decl(Decl::Friend, Empty), NextFriend(0) { }
+ : Decl(Decl::Friend, Empty), NextFriend() { }
+ FriendDecl *getNextFriend() {
+ return cast_or_null<FriendDecl>(
+ NextFriend.get(getASTContext().getExternalSource()));
+ }
+
public:
static FriendDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L, FriendUnion Friend_,
@@ -129,7 +134,7 @@ public:
friend_iterator &operator++() {
assert(Ptr && "attempt to increment past end of friend list");
- Ptr = Ptr->NextFriend;
+ Ptr = Ptr->getNextFriend();
return *this;
}