diff options
| author | John McCall <rjmccall@apple.com> | 2010-04-06 21:38:20 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-04-06 21:38:20 +0000 |
| commit | a8ae222d0e8ba667c3aadbd1a146b7de1afd3513 (patch) | |
| tree | f5aca4ad37193044a41d8ab53fae11c6954d5fa8 /clang/lib/AST/Expr.cpp | |
| parent | 4dac890600ea2265bd87ba4c903281ae5d08269e (diff) | |
| download | bcm5719-llvm-a8ae222d0e8ba667c3aadbd1a146b7de1afd3513.tar.gz bcm5719-llvm-a8ae222d0e8ba667c3aadbd1a146b7de1afd3513.zip | |
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.
llvm-svn: 100562
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index ae4bc8c8012..132245e671c 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/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); |

