summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-06 23:23:20 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-06 23:23:20 +0000
commit9321ad3f970714e3ca40d7c3461ff3acdbf8f7e7 (patch)
tree2d4bcdcbb8797c07c801de2a2ec5d5bd834dfc08 /clang/lib/Sema/SemaDecl.cpp
parent1456cd20b47af6e105652105a236695e3ea38698 (diff)
downloadbcm5719-llvm-9321ad3f970714e3ca40d7c3461ff3acdbf8f7e7.tar.gz
bcm5719-llvm-9321ad3f970714e3ca40d7c3461ff3acdbf8f7e7.zip
When using an unavailable/deprecated interface Foo inside Foo's interface/implementation
don't emit unavailable errors. llvm-svn: 141334
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 534cd488e75..4a4862bec4c 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud