<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 12, 2011, at 3:27 PM, Eli Friedman wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Tue, Jul 12, 2011 at 3:05 PM, Fariborz Jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:<br><blockquote type="cite">Author: fjahanian<br></blockquote><blockquote type="cite">Date: Tue Jul 12 17:05:16 2011<br></blockquote><blockquote type="cite">New Revision: 135001<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=135001&view=rev">http://llvm.org/viewvc/llvm-project?rev=135001&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">objc++: Some level of covariance is allowed in ObjC properties.<br></blockquote><blockquote type="cite">Make it also available in ObjC++ propeties. // <a href="rdar://9740328">rdar://9740328</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Added:<br></blockquote><blockquote type="cite">   cfe/trunk/test/SemaObjCXX/property-type-mismatch.mm<br></blockquote><blockquote type="cite">Modified:<br></blockquote><blockquote type="cite">   cfe/trunk/include/clang/AST/ASTContext.h<br></blockquote><blockquote type="cite">   cfe/trunk/lib/AST/ASTContext.cpp<br></blockquote><blockquote type="cite">   cfe/trunk/lib/Sema/SemaObjCProperty.cpp<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: cfe/trunk/include/clang/AST/ASTContext.h<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=135001&r1=135000&r2=135001&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=135001&r1=135000&r2=135001&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- cfe/trunk/include/clang/AST/ASTContext.h (original)<br></blockquote><blockquote type="cite">+++ cfe/trunk/include/clang/AST/ASTContext.h Tue Jul 12 17:05:16 2011<br></blockquote><blockquote type="cite">@@ -1417,6 +1417,7 @@<br></blockquote><blockquote type="cite">  bool typesAreCompatible(QualType T1, QualType T2,<br></blockquote><blockquote type="cite">                          bool CompareUnqualified = false); // C99 6.2.7p1<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+  bool propertyTypesAreCompatible(QualType, QualType);<br></blockquote><blockquote type="cite">  bool typesAreBlockPointerCompatible(QualType, QualType);<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">  bool isObjCIdType(QualType T) const {<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: cfe/trunk/lib/AST/ASTContext.cpp<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=135001&r1=135000&r2=135001&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=135001&r1=135000&r2=135001&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- cfe/trunk/lib/AST/ASTContext.cpp (original)<br></blockquote><blockquote type="cite">+++ cfe/trunk/lib/AST/ASTContext.cpp Tue Jul 12 17:05:16 2011<br></blockquote><blockquote type="cite">@@ -5441,6 +5441,10 @@<br></blockquote><blockquote type="cite">  return !mergeTypes(LHS, RHS, false, CompareUnqualified).isNull();<br></blockquote><blockquote type="cite"> }<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+bool ASTContext::propertyTypesAreCompatible(QualType LHS, QualType RHS) {<br></blockquote><blockquote type="cite">+  return !mergeTypes(LHS, RHS, false, false).isNull();<br></blockquote><blockquote type="cite">+}<br></blockquote><br>Using mergeTypes in C++ is generally a bad idea... it's fundamentally<br>implementing C semantics that don't make sense in C++, and it has<br>assertions which are easy to trigger in C++.<br></div></blockquote><div><br></div>It is being used in several places for c and c++. Comment at the very top of that routine suggests that caller</div><div>may come from c++ land. Properties are in the domain of objective-c. So, I doubt any c++ specific type</div><div>can trigger an assert and be usable as a property type. But, I can be convinced with an example.</div><div><br></div><div>- fariborz</div><div><br><blockquote type="cite"><div><br>-Eli<br><font class="Apple-style-span" color="#006312"><br></font></div></blockquote></div><br></body></html>