[cfe-commits] r141201 - in /cfe/trunk: lib/Sema/SemaDeclObjC.cpp test/Rewriter/protocol-rewrite-2.m
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Oct 5 12:37:57 PDT 2011
Author: akirtzidis
Date: Wed Oct 5 14:37:56 2011
New Revision: 141201
URL: http://llvm.org/viewvc/llvm-project?rev=141201&view=rev
Log:
Fix the rewriter, rdar://10234024.
Added:
cfe/trunk/test/Rewriter/protocol-rewrite-2.m
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=141201&r1=141200&r2=141201&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Wed Oct 5 14:37:56 2011
@@ -586,7 +586,8 @@
ProtocolName, ProtocolLoc, PDecl->getLocation(), PList);
// Make sure the cached decl gets a valid start location.
- PDecl->setLocation(AtProtoInterfaceLoc);
+ PDecl->setAtStartLoc(AtProtoInterfaceLoc);
+ PDecl->setLocation(ProtocolLoc);
PDecl->setForwardDecl(false);
// Since this ObjCProtocolDecl was created by a forward declaration,
// we now add it to the DeclContext since it wasn't added before
Added: cfe/trunk/test/Rewriter/protocol-rewrite-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/protocol-rewrite-2.m?rev=141201&view=auto
==============================================================================
--- cfe/trunk/test/Rewriter/protocol-rewrite-2.m (added)
+++ cfe/trunk/test/Rewriter/protocol-rewrite-2.m Wed Oct 5 14:37:56 2011
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -rewrite-objc %s -o %t.cpp
+// RUN: %clang_cc1 -fsyntax-only %t.cpp
+
+// rdar://10234024
+ at protocol Foo;
+ at protocol Foo
+ at end
More information about the cfe-commits
mailing list