forked from OSchip/llvm-project
Fix crash on an @interface nested inside @implementation, rdar://10336158
llvm-svn: 143085
This commit is contained in:
parent
f26b12ada0
commit
a9aabf7d51
|
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue