Skip to content

Commit

Permalink
Fix the rewriter, rdar://10234024.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141201 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
akyrtzi committed Oct 5, 2011
1 parent 42b2984 commit a1e797e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Sema/SemaDeclObjC.cpp
Expand Up @@ -586,7 +586,8 @@ Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc,
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
Expand Down
7 changes: 7 additions & 0 deletions test/Rewriter/protocol-rewrite-2.m
@@ -0,0 +1,7 @@
// RUN: %clang_cc1 -rewrite-objc %s -o %t.cpp
// RUN: %clang_cc1 -fsyntax-only %t.cpp

// rdar://10234024
@protocol Foo;
@protocol Foo
@end

0 comments on commit a1e797e

Please sign in to comment.