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 | 161755a09898c95d21bfff33707da9ca41cd53c5 (patch) | |
tree | 4d28a74efb5679a70228e2612b17b9bdb2785f78 /lib/Sema/Lookup.h | |
parent | 2e4c7a5865739709a310d847da34096aa402d183 (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/Sema/Lookup.h')
-rw-r--r-- | lib/Sema/Lookup.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Sema/Lookup.h b/lib/Sema/Lookup.h index f310c253ab..73559a246d 100644 --- a/lib/Sema/Lookup.h +++ b/lib/Sema/Lookup.h @@ -282,6 +282,18 @@ public: NamingClass = Record; } + /// \brief Returns the base object type associated with this lookup; + /// important for [class.protected]. Most lookups do not have an + /// associated base object. + QualType getBaseObjectType() const { + return BaseObjectType; + } + + /// \brief Sets the base object type for this lookup. + void setBaseObjectType(QualType T) { + BaseObjectType = T; + } + /// \brief Add a declaration to these results with its natural access. /// Does not test the acceptance criteria. void addDecl(NamedDecl *D) { @@ -550,6 +562,7 @@ private: UnresolvedSet<8> Decls; CXXBasePaths *Paths; CXXRecordDecl *NamingClass; + QualType BaseObjectType; // Parameters. Sema &SemaRef; |