forked from OSchip/llvm-project
Fix crash when using archaic protocol, rdar://10238337
llvm-svn: 141215
This commit is contained in:
parent
3abead76ea
commit
a7324ede34
|
@ -54,8 +54,11 @@ SourceLocation getArgLoc<Expr>(Expr *Arg) {
|
|||
|
||||
template <>
|
||||
SourceLocation getArgLoc<ParmVarDecl>(ParmVarDecl *Arg) {
|
||||
SourceLocation Loc = Arg->getLocStart();
|
||||
if (Loc.isInvalid())
|
||||
return Loc;
|
||||
// -1 to point to left paren of the method parameter's type.
|
||||
return Arg->getLocStart().getLocWithOffset(-1);
|
||||
return Loc.getLocWithOffset(-1);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
|
|
@ -33,3 +33,10 @@ typedef struct objc_class *Class;
|
|||
|
||||
Class <SomeProtocol> UnfortunateGCCExtension;
|
||||
|
||||
// rdar://10238337
|
||||
@protocol Broken @end
|
||||
@interface Crash @end
|
||||
@implementation Crash
|
||||
- (void)crashWith:(<Broken>)a { // expected-warning {{protocol qualifiers without 'id' is archaic}}
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue