diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-03-03 01:13:25 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-03-03 01:13:25 +0000 |
| commit | 77709906a4f6391e8db2e22e61fc2d4eff4376b4 (patch) | |
| tree | 3dbf1c90af67a64d1a43b78da008877094828250 /clang/lib | |
| parent | 47307292f1c04f1a76cae5b8033da4610b2a8827 (diff) | |
| download | bcm5719-llvm-77709906a4f6391e8db2e22e61fc2d4eff4376b4.tar.gz bcm5719-llvm-77709906a4f6391e8db2e22e61fc2d4eff4376b4.zip | |
Revert r97618. Access control sucks
llvm-svn: 97621
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/CXXInheritance.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/clang/lib/AST/CXXInheritance.cpp b/clang/lib/AST/CXXInheritance.cpp index 265b454975b..99f908caeab 100644 --- a/clang/lib/AST/CXXInheritance.cpp +++ b/clang/lib/AST/CXXInheritance.cpp @@ -140,20 +140,18 @@ bool CXXRecordDecl::forallBases(ForallBasesCallback *BaseMatches, return AllMatches; } -static bool lookupInBases(ASTContext &Context, const CXXRecordDecl *Record, - CXXRecordDecl::BaseMatchesCallback *BaseMatches, - void *UserData, - CXXBasePaths &Paths) { +bool CXXRecordDecl::lookupInBases(BaseMatchesCallback *BaseMatches, + void *UserData, + CXXBasePaths &Paths) const { bool FoundPath = false; // The access of the path down to this record. AccessSpecifier AccessToHere = Paths.ScratchPath.Access; bool IsFirstStep = Paths.ScratchPath.empty(); - for (CXXRecordDecl::base_class_const_iterator BaseSpec = Record->bases_begin(), - BaseSpecEnd = Record->bases_end(); - BaseSpec != BaseSpecEnd; - ++BaseSpec) { + ASTContext &Context = getASTContext(); + for (base_class_const_iterator BaseSpec = bases_begin(), + BaseSpecEnd = bases_end(); BaseSpec != BaseSpecEnd; ++BaseSpec) { // Find the record of the base class subobjects for this type. QualType BaseType = Context.getCanonicalType(BaseSpec->getType()) .getUnqualifiedType(); @@ -188,7 +186,7 @@ static bool lookupInBases(ASTContext &Context, const CXXRecordDecl *Record, // Add this base specifier to the current path. CXXBasePathElement Element; Element.Base = &*BaseSpec; - Element.Class = Record; + Element.Class = this; if (BaseSpec->isVirtual()) Element.SubobjectNumber = 0; else @@ -214,8 +212,7 @@ static bool lookupInBases(ASTContext &Context, const CXXRecordDecl *Record, Paths.ScratchPath.Access = BaseSpec->getAccessSpecifier(); else Paths.ScratchPath.Access - = CXXRecordDecl::MergeAccess(AccessToHere, - BaseSpec->getAccessSpecifier()); + = MergeAccess(AccessToHere, BaseSpec->getAccessSpecifier()); } // Track whether there's a path involving this specific base. @@ -236,7 +233,7 @@ static bool lookupInBases(ASTContext &Context, const CXXRecordDecl *Record, CXXRecordDecl *BaseRecord = cast<CXXRecordDecl>(BaseSpec->getType()->getAs<RecordType>() ->getDecl()); - if (lookupInBases(Context, BaseRecord, BaseMatches, UserData, Paths)) { + if (BaseRecord->lookupInBases(BaseMatches, UserData, Paths)) { // C++ [class.member.lookup]p2: // A member name f in one sub-object B hides a member name f in // a sub-object A if A is a base class sub-object of B. Any @@ -269,12 +266,6 @@ static bool lookupInBases(ASTContext &Context, const CXXRecordDecl *Record, return FoundPath; } -bool CXXRecordDecl::lookupInBases(BaseMatchesCallback *BaseMatches, - void *UserData, - CXXBasePaths &Paths) const { - return ::lookupInBases(getASTContext(), this, BaseMatches, UserData, Paths); -} - bool CXXRecordDecl::FindBaseClass(const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *BaseRecord) { |

