forked from OSchip/llvm-project
[PCH] Clear switch case IDs when deserializing a objc method body.
Fixes rdar://11353109 & http://llvm.org/bugs/show_bug.cgi?id=12689 llvm-svn: 156056
This commit is contained in:
parent
1655aee1e3
commit
2a5deff59d
|
@ -629,6 +629,8 @@ void ASTDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) {
|
|||
if (Record[Idx++]) {
|
||||
// In practice, this won't be executed (since method definitions
|
||||
// don't occur in header files).
|
||||
// Switch case IDs are per method body.
|
||||
Reader.ClearSwitchCaseIDs();
|
||||
MD->setBody(Reader.ReadStmt(F));
|
||||
MD->setSelfDecl(ReadDeclAs<ImplicitParamDecl>(Record, Idx));
|
||||
MD->setCmdDecl(ReadDeclAs<ImplicitParamDecl>(Record, Idx));
|
||||
|
|
|
@ -9,3 +9,19 @@
|
|||
|
||||
// FIXME: @compatibility_alias AliasForTestPCH TestPCH;
|
||||
|
||||
// http://llvm.org/PR12689
|
||||
@interface PR12689
|
||||
@end
|
||||
|
||||
@implementation PR12689
|
||||
-(void)mugi:(int)x {
|
||||
switch(x) {
|
||||
case 23: {}
|
||||
}
|
||||
}
|
||||
-(void)bonk:(int)x {
|
||||
switch(x) {
|
||||
case 42: {}
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue