From ddd600f3281f6c23564afc17550e186ca9c43631 Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Wed, 14 Nov 2007 14:15:31 +0000 Subject: [PATCH] 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 --- Sema/SemaDecl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index 36813bafca..dc1a993519 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -1742,7 +1742,11 @@ Sema::DeclTy *Sema::ActOnField(Scope *S, DeclTy *TagDecl, NewFD = new FieldDecl(Loc, II, T, BitWidth); else if (isa(static_cast(TagDecl)) || isa(static_cast(TagDecl)) || - isa(static_cast(TagDecl))) + isa(static_cast(TagDecl)) || + // FIXME: ivars are currently used to model properties, and + // properties can appear within a protocol. + // See corresponding FIXME in DeclObjC.h:ObjcPropertyDecl. + isa(static_cast(TagDecl))) NewFD = new ObjcIvarDecl(Loc, II, T); else assert(0 && "Sema::ActOnField(): Unknown TagDecl"); -- 2.40.0