[llvm-branch-commits] [cfe-branch] r110969 - in /cfe/branches/Apple/whitney-IB/src/tools/clang: ./ lib/AST/ASTContext.cpp test/SemaObjC/block-type-safety.m test/SemaObjC/comptypes-5.m
Daniel Dunbar
daniel at zuster.org
Thu Aug 12 15:45:12 PDT 2010
Author: ddunbar
Date: Thu Aug 12 17:45:12 2010
New Revision: 110969
URL: http://llvm.org/viewvc/llvm-project?rev=110969&view=rev
Log:
--- Merging r110950 into 'src/tools/clang':
U src/tools/clang/test/SemaObjC/block-type-safety.m
U src/tools/clang/test/SemaObjC/comptypes-5.m
U src/tools/clang/lib/AST/ASTContext.cpp
Modified:
cfe/branches/Apple/whitney-IB/src/tools/clang/ (props changed)
cfe/branches/Apple/whitney-IB/src/tools/clang/lib/AST/ASTContext.cpp
cfe/branches/Apple/whitney-IB/src/tools/clang/test/SemaObjC/block-type-safety.m
cfe/branches/Apple/whitney-IB/src/tools/clang/test/SemaObjC/comptypes-5.m
Propchange: cfe/branches/Apple/whitney-IB/src/tools/clang/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 12 17:45:12 2010
@@ -1 +1 @@
-/cfe/trunk:110882,110901,110906
+/cfe/trunk:110882,110901,110906,110950
Modified: cfe/branches/Apple/whitney-IB/src/tools/clang/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/tools/clang/lib/AST/ASTContext.cpp?rev=110969&r1=110968&r2=110969&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/tools/clang/lib/AST/ASTContext.cpp (original)
+++ cfe/branches/Apple/whitney-IB/src/tools/clang/lib/AST/ASTContext.cpp Thu Aug 12 17:45:12 2010
@@ -4326,7 +4326,7 @@
// when comparing an id<P> on rhs with a static type on lhs,
// static class must implement all of id's protocols directly or
// indirectly through its super class.
- if (lhsID->ClassImplementsProtocol(*I, false)) {
+ if (lhsID->ClassImplementsProtocol(*I, true)) {
match = true;
break;
}
Modified: cfe/branches/Apple/whitney-IB/src/tools/clang/test/SemaObjC/block-type-safety.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/tools/clang/test/SemaObjC/block-type-safety.m?rev=110969&r1=110968&r2=110969&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/tools/clang/test/SemaObjC/block-type-safety.m (original)
+++ cfe/branches/Apple/whitney-IB/src/tools/clang/test/SemaObjC/block-type-safety.m Thu Aug 12 17:45:12 2010
@@ -104,3 +104,20 @@
f4(^(NSArray<P2>* a) { }); // expected-error {{incompatible block pointer types passing 'void (^)(NSArray<P2> *)' to parameter of type 'void (^)(id<P>)'}}
}
+// rdar : //8302845
+ at protocol Foo @end
+
+ at interface Baz @end
+
+ at interface Baz(FooConformance) <Foo>
+ at end
+
+ at implementation Baz @end
+
+int test4 () {
+ id <Foo> (^b)() = ^{ // Doesn't work
+ return (Baz *)0;
+ };
+ return 0;
+}
+
Modified: cfe/branches/Apple/whitney-IB/src/tools/clang/test/SemaObjC/comptypes-5.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/tools/clang/test/SemaObjC/comptypes-5.m?rev=110969&r1=110968&r2=110969&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/tools/clang/test/SemaObjC/comptypes-5.m (original)
+++ cfe/branches/Apple/whitney-IB/src/tools/clang/test/SemaObjC/comptypes-5.m Thu Aug 12 17:45:12 2010
@@ -26,8 +26,8 @@
MyOtherClass<MyProtocol> *obj_c_super_p_q = nil;
MyClass<MyProtocol> *obj_c_cat_p_q = nil;
- obj_c_cat_p = obj_id_p; // expected-warning {{assigning to 'MyClass *' from incompatible type 'id<MyProtocol>'}}
- obj_c_super_p = obj_id_p; // expected-warning {{assigning to 'MyOtherClass *' from incompatible type 'id<MyProtocol>'}}
+ obj_c_cat_p = obj_id_p;
+ obj_c_super_p = obj_id_p;
obj_id_p = obj_c_cat_p; /* Ok */
obj_id_p = obj_c_super_p; /* Ok */
More information about the llvm-branch-commits
mailing list