<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jul 5, 2013, at 11:05 AM, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Uh, I think the real error in this test case is that you can't meaningfully @synthesize a reference property. What happens without the reference?</div></div></blockquote><div dir="auto"><br></div>Test was not meant to test reference type. Test is fixed in r<span style="font-family: Menlo; font-size: 11px;">185734 and issues the intended error on use of abstract class type.</span></div><div><font face="Menlo"><span style="font-size: 11px;">For reasons that escapes me (gcc compatibility maybe?) we do allow designation of reference type on</span></font></div><div><font face="Menlo"><span style="font-size: 11px;">properties. Except that ivars are by-value of the underlying type, getter returns reference to ivar, etc.</span></font></div><div><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div><font face="Menlo"><span style="font-size: 11px;">- Fariborz</span></font></div><div><font face="Menlo"><span style="font-size: 11px;"><br></span></font><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><br><div><div>On Jul 5, 2013, at 10:18 , Fariborz Jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Author: fjahanian<br>Date: Fri Jul 5 12:18:11 2013<br>New Revision: 185710<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=185710&view=rev">http://llvm.org/viewvc/llvm-project?rev=185710&view=rev</a><br>Log:<br>Objective-C: diagnose when synthesizing an ivar of<br>abstract class type. //<span class="Apple-converted-space"> </span><a href="rdar://14261999">rdar://14261999</a><br><br>Modified:<br> cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br> cfe/trunk/include/clang/Sema/Sema.h<br> cfe/trunk/lib/Sema/SemaObjCProperty.cpp<br> cfe/trunk/test/SemaObjCXX/abstract-class-type-ivar.mm<br><br>Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=185710&r1=185709&r2=185710&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=185710&r1=185709&r2=185710&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br>+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Jul 5 12:18:11 2013<br>@@ -911,7 +911,8 @@ def err_invalid_base_in_interface : Erro<br> "%select{'struct|non-public 'interface|'class}0 %1'">;<br><br>def err_abstract_type_in_decl : Error<<br>- "%select{return|parameter|variable|field|instance variable}0 type %1 is an abstract class">;<br>+ "%select{return|parameter|variable|field|instance variable|"<br>+ "synthesized instance variable}0 type %1 is an abstract class">;<br>def err_allocation_of_abstract_type : Error<<br> "allocating an object of abstract class type %0">;<br>def err_throw_abstract_type : Error<<br><br>Modified: cfe/trunk/include/clang/Sema/Sema.h<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=185710&r1=185709&r2=185710&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=185710&r1=185709&r2=185710&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/Sema/Sema.h (original)<br>+++ cfe/trunk/include/clang/Sema/Sema.h Fri Jul 5 12:18:11 2013<br>@@ -4835,6 +4835,7 @@ public:<br> AbstractVariableType,<br> AbstractFieldType,<br> AbstractIvarType,<br>+ AbstractSynthesizedIvarType,<br> AbstractArrayType<br> };<br><br><br>Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=185710&r1=185709&r2=185710&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=185710&r1=185709&r2=185710&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)<br>+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Fri Jul 5 12:18:11 2013<br>@@ -1082,8 +1082,14 @@ Decl *Sema::ActOnPropertyImplDecl(Scope<br> PropertyIvarType, /*Dinfo=*/0,<br> ObjCIvarDecl::Private,<br> (Expr *)0, true);<br>- if (CompleteTypeErr)<br>+ if (RequireNonAbstractType(PropertyIvarLoc,<br>+ PropertyIvarType,<br>+ diag::err_abstract_type_in_decl,<br>+ AbstractSynthesizedIvarType)) {<br>+ Diag(property->getLocation(), diag::note_property_declare);<br> Ivar->setInvalidDecl();<br>+ } else if (CompleteTypeErr)<br>+ Ivar->setInvalidDecl();<br> ClassImpDecl->addDecl(Ivar);<br> IDecl->makeDeclVisibleInContext(Ivar);<br><br><br>Modified: cfe/trunk/test/SemaObjCXX/abstract-class-type-ivar.mm<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/abstract-class-type-ivar.mm?rev=185710&r1=185709&r2=185710&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/abstract-class-type-ivar.mm?rev=185710&r1=185709&r2=185710&view=diff</a><br>==============================================================================<br>--- cfe/trunk/test/SemaObjCXX/abstract-class-type-ivar.mm (original)<br>+++ cfe/trunk/test/SemaObjCXX/abstract-class-type-ivar.mm Fri Jul 5 12:18:11 2013<br>@@ -1,5 +1,6 @@<br>// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s<br>//<span class="Apple-converted-space"> </span><a href="rdar://12095239">rdar://12095239</a><br>+//<span class="Apple-converted-space"> </span><a href="rdar://14261999">rdar://14261999</a><br><br>class CppAbstractBase {<br>public:<br>@@ -16,11 +17,14 @@ class CppConcreteSub : public CppAbstrac<br> CppConcreteSub _concrete; // expected-error{{instance variable type 'CppConcreteSub' is an abstract class}}<br>}<br>- (CppAbstractBase*)abstract;<br>+@property (nonatomic, readonly) const CppConcreteSub& Prop; // expected-note {{property declared here}}<br>@end<br>+<br>@implementation Objc<br>- (CppAbstractBase*)abstract {<br> return &_concrete;<br>}<br>+@synthesize Prop; // expected-error {{synthesized instance variable type 'const CppConcreteSub' is an abstract class}}<br>@end<br><br>class Cpp {<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></div></blockquote></div></div></blockquote></div><br></body></html>