summaryrefslogtreecommitdiffstats
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
commiteb03dace8735b739446c3a4cffc70b566e43f2a2 (patch)
tree80fecdad61c8c204f7f24e14c4f3a765a1b7e456
parenta21ff583db91420cc2e9c793b217677a83b3d383 (diff)
downloadbcm5719-llvm-eb03dace8735b739446c3a4cffc70b566e43f2a2.tar.gz
bcm5719-llvm-eb03dace8735b739446c3a4cffc70b566e43f2a2.zip
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 llvm-svn: 54740
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index e2c58c22a4e..28768fc56b2 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud