diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-12-16 00:38:16 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-12-16 00:38:16 +0000 |
commit | 0a59acb9ae36077ce46fb2807956c5e84f0f6837 (patch) | |
tree | 603076e0e36496c151d8e56116c8fe8c6f622e6f /lib/Sema/SemaCXXScopeSpec.cpp | |
parent | 69497c315fd2bfebc7b7a8180d9125fa8b17b292 (diff) |
Make name lookup when we're inside a declarator's scope, such as ClassName::func, work with the new unqualified name lookup code. Test it with default arguments in out-of-line member definitions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCXXScopeSpec.cpp')
-rw-r--r-- | lib/Sema/SemaCXXScopeSpec.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp index 193e259f1d..8b3218b33b 100644 --- a/lib/Sema/SemaCXXScopeSpec.cpp +++ b/lib/Sema/SemaCXXScopeSpec.cpp @@ -134,8 +134,8 @@ Sema::CXXScopeTy *Sema::ActOnCXXNestedNameSpecifier(Scope *S, void Sema::ActOnCXXEnterDeclaratorScope(Scope *S, const CXXScopeSpec &SS) {
assert(SS.isSet() && "Parser passed invalid CXXScopeSpec.");
assert(PreDeclaratorDC == 0 && "Previous declarator context not popped?");
- PreDeclaratorDC = CurContext;
- CurContext = static_cast<DeclContext*>(SS.getScopeRep());
+ PreDeclaratorDC = static_cast<DeclContext*>(S->getEntity());
+ S->setEntity(static_cast<DeclContext*>(SS.getScopeRep()));
}
/// ActOnCXXExitDeclaratorScope - Called when a declarator that previously
@@ -143,10 +143,9 @@ void Sema::ActOnCXXEnterDeclaratorScope(Scope *S, const CXXScopeSpec &SS) { /// CXXScopeSpec that was passed to ActOnCXXEnterDeclaratorScope as well.
/// Used to indicate that names should revert to being looked up in the
/// defining scope.
-void Sema::ActOnCXXExitDeclaratorScope(const CXXScopeSpec &SS) {
+void Sema::ActOnCXXExitDeclaratorScope(Scope *S, const CXXScopeSpec &SS) {
assert(SS.isSet() && "Parser passed invalid CXXScopeSpec.");
- assert(CurContext == static_cast<DeclContext*>(SS.getScopeRep()) &&
- "Context imbalance!");
- CurContext = PreDeclaratorDC;
+ assert(S->getEntity() == SS.getScopeRep() && "Context imbalance!");
+ S->setEntity(PreDeclaratorDC);
PreDeclaratorDC = 0;
}
|