The following case resulted in an invalid start location:
// start location not being set for ObjCProtocolDecl AST (when a forward reference is in scope).
@protocol Buggy;
@protocol Buggy
@optional
- whatever;
@end
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54740
91177308-0d34-0410-b5e6-
96231b3b80d8
// FIXME: don't leak the objects passed in!
return PDecl;
}
-
+ // Make sure the cached decl gets a valid start location.
+ PDecl->setLocation(AtProtoInterfaceLoc);
PDecl->setForwardDecl(false);
} else {
PDecl = ObjCProtocolDecl::Create(Context, AtProtoInterfaceLoc,ProtocolName);