forked from OSchip/llvm-project
[ASTImporter] Fix missing SourceLoc import for ObjCMethodDecl selectors
Patch by Nico Rieck, test case by Sean Callanan! Differential Revision: https://reviews.llvm.org/D6550 llvm-svn: 322079
This commit is contained in:
parent
5d909be91b
commit
47dbaf6c8e
|
@ -2857,9 +2857,13 @@ Decl *ASTNodeImporter::VisitObjCMethodDecl(ObjCMethodDecl *D) {
|
|||
ToParams[I]->setOwningFunction(ToMethod);
|
||||
ToMethod->addDeclInternal(ToParams[I]);
|
||||
}
|
||||
|
||||
SmallVector<SourceLocation, 12> SelLocs;
|
||||
D->getSelectorLocs(SelLocs);
|
||||
ToMethod->setMethodParams(Importer.getToContext(), ToParams, SelLocs);
|
||||
for (SourceLocation &Loc : SelLocs)
|
||||
Loc = Importer.Import(Loc);
|
||||
|
||||
ToMethod->setMethodParams(Importer.getToContext(), ToParams, SelLocs);
|
||||
|
||||
ToMethod->setLexicalDeclContext(LexicalDC);
|
||||
Importer.Imported(D, ToMethod);
|
||||
|
|
|
@ -100,4 +100,6 @@
|
|||
@implementation I15 : I12
|
||||
@end
|
||||
|
||||
|
||||
@interface ImportSelectorSLoc { }
|
||||
-(int)addInt:(int)a toInt:(int)b moduloInt:(int)c; // don't crash here
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue