diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-06 23:23:20 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-06 23:23:20 +0000 |
commit | 3a387441ae339363ee5b254658f295e97bd9e913 (patch) | |
tree | 4e39ccc7508ba46e5fa86a101f215ff736cc894e /lib/Sema/SemaDecl.cpp | |
parent | 51c3b79caa493a53d324190c0d7e3cd1fe93d4f3 (diff) |
When using an unavailable/deprecated interface Foo inside Foo's interface/implementation
don't emit unavailable errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141334 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 534cd488e7..4a4862bec4 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -8004,13 +8004,14 @@ void Sema::ActOnTagStartDefinition(Scope *S, Decl *TagD) { PushDeclContext(S, Tag); } -void Sema::ActOnObjCContainerStartDefinition(Decl *IDecl) { +Decl *Sema::ActOnObjCContainerStartDefinition(Decl *IDecl) { assert(isa<ObjCContainerDecl>(IDecl) && "ActOnObjCContainerStartDefinition - Not ObjCContainerDecl"); DeclContext *OCD = cast<DeclContext>(IDecl); assert(getContainingDC(OCD) == CurContext && "The next DeclContext should be lexically contained in the current one."); CurContext = OCD; + return IDecl; } void Sema::ActOnStartCXXMemberDeclarations(Scope *S, Decl *TagD, @@ -8068,7 +8069,17 @@ void Sema::ActOnObjCContainerFinishDefinition() { // Exit this scope of this interface definition. PopDeclContext(); } - + +void Sema::ActOnObjCTemporaryExitContainerContext() { + OriginalLexicalContext = CurContext; + ActOnObjCContainerFinishDefinition(); +} + +void Sema::ActOnObjCReenterContainerContext() { + ActOnObjCContainerStartDefinition(cast<Decl>(OriginalLexicalContext)); + OriginalLexicalContext = 0; +} + void Sema::ActOnTagDefinitionError(Scope *S, Decl *TagD) { AdjustDeclIfTemplate(TagD); TagDecl *Tag = cast<TagDecl>(TagD); |