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 e2c58c2..28768fc 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -199,7 +199,8 @@
       // 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);