[cfe-commits] r44117 - /cfe/trunk/Sema/SemaDecl.cpp

Steve Naroff snaroff at apple.com
Wed Nov 14 06:15:31 PST 2007


Author: snaroff
Date: Wed Nov 14 08:15:31 2007
New Revision: 44117

URL: http://llvm.org/viewvc/llvm-project?rev=44117&view=rev
Log:

Allow properties within a protocol. The case below was asserting...now it works fine.

@protocol CAMediaTiming

@property int beginTime;

@end

Comments in the code tell the rest of the story...


Modified:
    cfe/trunk/Sema/SemaDecl.cpp

Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=44117&r1=44116&r2=44117&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Wed Nov 14 08:15:31 2007
@@ -1742,7 +1742,11 @@
     NewFD = new FieldDecl(Loc, II, T, BitWidth);
   else if (isa<ObjcInterfaceDecl>(static_cast<Decl *>(TagDecl)) ||
            isa<ObjcImplementationDecl>(static_cast<Decl *>(TagDecl)) ||
-           isa<ObjcCategoryDecl>(static_cast<Decl *>(TagDecl)))
+           isa<ObjcCategoryDecl>(static_cast<Decl *>(TagDecl)) ||
+           // FIXME: ivars are currently used to model properties, and
+           // properties can appear within a protocol.
+           // See corresponding FIXME in DeclObjC.h:ObjcPropertyDecl.
+           isa<ObjcProtocolDecl>(static_cast<Decl *>(TagDecl)))
     NewFD = new ObjcIvarDecl(Loc, II, T);
   else
     assert(0 && "Sema::ActOnField(): Unknown TagDecl");





More information about the cfe-commits mailing list