diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-02-25 00:23:44 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-02-25 00:23:44 +0000 |
commit | 4250459fdc01e1bb4fe18b309021c8b4c736153c (patch) | |
tree | f90de7416cebd7c2d690c8b51ec1329a365b3d61 /clang/test/SemaObjC/arc-type-conversion.m | |
parent | 2f01805b191db7315971063fc2f2422fafc899e9 (diff) |
Improve the diagnostic in ARC mode when a conditional with an Objective-C type and void* is used. <rdar://problem/10486347>.
Diffstat (limited to 'clang/test/SemaObjC/arc-type-conversion.m')
-rw-r--r-- | clang/test/SemaObjC/arc-type-conversion.m | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/arc-type-conversion.m b/clang/test/SemaObjC/arc-type-conversion.m index 8d8ff984fe9..5cf2cf4b745 100644 --- a/clang/test/SemaObjC/arc-type-conversion.m +++ b/clang/test/SemaObjC/arc-type-conversion.m @@ -90,3 +90,9 @@ void ownership_transfer_in_cast(void *vp, Block *pblk) { (void)(Block)&lv; // expected-error {{cast of an indirect pointer to an Objective-C pointer to 'Block'}} (void)(Block*)lv; // expected-error {{cast of an Objective-C pointer to '__strong Block *'}} } + +// <rdar://problem/10486347> +void conversion_in_conditional(id a, void* b) { + id c = 1 ? a : b; // expected-error {{operands to conditional of types 'id' and 'void *' are incompatible in ARC mode}} + id d = 1 ? b : a; // expected-error {{operands to conditional of types 'void *' and 'id' are incompatible in ARC mode}} +} |