aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-04-06 21:38:20 +0000
committerJohn McCall <rjmccall@apple.com>2010-04-06 21:38:20 +0000
commit161755a09898c95d21bfff33707da9ca41cd53c5 (patch)
tree4d28a74efb5679a70228e2612b17b9bdb2785f78 /lib/AST/Expr.cpp
parent2e4c7a5865739709a310d847da34096aa402d183 (diff)
Implement the protected access restriction ([class.protected]), which requires
that protected members be used on objects of types which derive from the naming class of the lookup. My first N attempts at this were poorly-founded, largely because the standard is very badly worded here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100562 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r--lib/AST/Expr.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index ae4bc8c801..132245e671 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -496,13 +496,15 @@ MemberExpr *MemberExpr::Create(ASTContext &C, Expr *base, bool isarrow,
NestedNameSpecifier *qual,
SourceRange qualrange,
ValueDecl *memberdecl,
- NamedDecl *founddecl,
+ DeclAccessPair founddecl,
SourceLocation l,
const TemplateArgumentListInfo *targs,
QualType ty) {
std::size_t Size = sizeof(MemberExpr);
- bool hasQualOrFound = (qual != 0 || founddecl != memberdecl);
+ bool hasQualOrFound = (qual != 0 ||
+ founddecl.getDecl() != memberdecl ||
+ founddecl.getAccess() != memberdecl->getAccess());
if (hasQualOrFound)
Size += sizeof(MemberNameQualifier);