aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-08-13 16:39:22 +0000
committerSteve Naroff <snaroff@apple.com>2008-08-13 16:39:22 +0000
commitf11b5088ec16b27d526489b10da20273eb268975 (patch)
tree4b68234068fabaae0467f48624e5410991505de1 /lib
parent298419aad5fb49f2623d73abec93d582e8b32067 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp3
1 files changed, 2 insertions, 1 deletions
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);