diff options
author | John McCall <rjmccall@apple.com> | 2010-01-20 21:53:11 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-01-20 21:53:11 +0000 |
commit | 401982f56c3633a4c77ddad49708795132265e13 (patch) | |
tree | 5aeb4c593a7e4f11c2221c1931d238c058c73e2e /clang/lib/Sema/SemaDecl.cpp | |
parent | dd969c897ecb31480f3cee2856ff72e0854d8527 (diff) | |
download | bcm5719-llvm-401982f56c3633a4c77ddad49708795132265e13.tar.gz bcm5719-llvm-401982f56c3633a4c77ddad49708795132265e13.zip |
First pass at collecting access-specifier information along inheritance paths.
Triggers lots of assertions about missing access information; fix them.
Will actually consume this information soon.
llvm-svn: 94038
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 1e46787d8f1..7e86120b169 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1305,6 +1305,9 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) { // Keep a chain of previous declarations. New->setPreviousDeclaration(Old); + + // Inherit access appropriately. + New->setAccess(Old->getAccess()); } static void MarkLive(CFGBlock *e, llvm::BitVector &live) { @@ -3361,6 +3364,10 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, } if (D.getCXXScopeSpec().isSet() && !NewFD->isInvalidDecl()) { + // Fake up an access specifier if it's supposed to be a class member. + if (isa<CXXRecordDecl>(NewFD->getDeclContext())) + NewFD->setAccess(AS_public); + // An out-of-line member function declaration must also be a // definition (C++ [dcl.meaning]p1). // Note that this is not the case for explicit specializations of |