diff options
-rw-r--r-- | include/clang/Parse/Parser.h | 4 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 4 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 | ||||
-rw-r--r-- | test/SemaObjC/incomplete-implementation.m | 13 |
4 files changed, 20 insertions, 7 deletions
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index c863e76b9d..673b5df093 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -607,11 +607,11 @@ private: explicit ObjCDeclContextSwitch(Parser &p) : P(p), DC(p.getObjCDeclContext()) { if (DC) - P.Actions.ActOnObjCTemporaryExitContainerContext(); + P.Actions.ActOnObjCTemporaryExitContainerContext(cast<DeclContext>(DC)); } ~ObjCDeclContextSwitch() { if (DC) - P.Actions.ActOnObjCReenterContainerContext(); + P.Actions.ActOnObjCReenterContainerContext(cast<DeclContext>(DC)); } }; diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index acfdf7a583..a0f4a628fa 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -1245,8 +1245,8 @@ public: /// scope for parsing/looking-up C constructs. /// /// Must be followed by a call to \see ActOnObjCReenterContainerContext - void ActOnObjCTemporaryExitContainerContext(); - void ActOnObjCReenterContainerContext(); + void ActOnObjCTemporaryExitContainerContext(DeclContext *DC); + void ActOnObjCReenterContainerContext(DeclContext *DC); /// ActOnTagDefinitionError - Invoked when there was an unrecoverable /// error parsing the definition of a tag. diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 7ad8fb34b8..4fa9cbdcc5 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -8287,13 +8287,13 @@ void Sema::ActOnObjCContainerFinishDefinition() { PopDeclContext(); } -void Sema::ActOnObjCTemporaryExitContainerContext() { +void Sema::ActOnObjCTemporaryExitContainerContext(DeclContext *DC) { OriginalLexicalContext = CurContext; ActOnObjCContainerFinishDefinition(); } -void Sema::ActOnObjCReenterContainerContext() { - ActOnObjCContainerStartDefinition(cast<Decl>(OriginalLexicalContext)); +void Sema::ActOnObjCReenterContainerContext(DeclContext *DC) { + ActOnObjCContainerStartDefinition(cast<Decl>(DC)); OriginalLexicalContext = 0; } diff --git a/test/SemaObjC/incomplete-implementation.m b/test/SemaObjC/incomplete-implementation.m index f5c5a7cc18..a79628aeed 100644 --- a/test/SemaObjC/incomplete-implementation.m +++ b/test/SemaObjC/incomplete-implementation.m @@ -24,4 +24,17 @@ - Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} @end +@interface Q +@end + +// rdar://10336158 +@implementation Q + +__attribute__((visibility("default"))) +@interface QN +{ +} +@end + +@end |