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...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44117 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index 36813ba..dc1a993 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -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");