diff options
author | John McCall <rjmccall@apple.com> | 2010-10-12 23:13:28 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-12 23:13:28 +0000 |
commit | 337ec3d0e8cb24a591ecbecdc0a995a167f6af01 (patch) | |
tree | 89d2d5bacb3c342ae3441f2ae811abec32ad88f0 /lib/Sema/SemaAccess.cpp | |
parent | 98efb9f6df133f5508d260c4510c6c3bd70f34ad (diff) |
Handle dependent friends more explicitly and deal with the possibility
of templated-scope friends by marking them invalid and white-listing all
accesses until such time as we implement them. Fixes a crash, this time
without a broken test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaAccess.cpp')
-rw-r--r-- | lib/Sema/SemaAccess.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaAccess.cpp b/lib/Sema/SemaAccess.cpp index e629f0fd35..ea6481bd8a 100644 --- a/lib/Sema/SemaAccess.cpp +++ b/lib/Sema/SemaAccess.cpp @@ -516,6 +516,10 @@ static AccessResult MatchesFriend(Sema &S, static AccessResult MatchesFriend(Sema &S, const EffectiveContext &EC, FriendDecl *FriendD) { + // Whitelist accesses if there's an invalid friend declaration. + if (FriendD->isInvalidDecl()) + return AR_accessible; + if (TypeSourceInfo *T = FriendD->getFriendType()) return MatchesFriend(S, EC, T->getType()->getCanonicalTypeUnqualified()); |