From: Steve Naroff Date: Wed, 13 Aug 2008 16:39:22 +0000 (+0000) Subject: Sema::ActOnStartProtocolInterface(): Make sure the protocol decl has a valid start... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f11b5088ec16b27d526489b10da20273eb268975;p=clang Sema::ActOnStartProtocolInterface(): Make sure the protocol decl has a valid start location. 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 --- diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index e2c58c22a4..28768fc56b 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -199,7 +199,8 @@ Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc, // 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);