Fariborz Jahanian | b351a7d | 2010-01-20 22:54:38 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s |
2 | // radar 7562285 | ||||
3 | |||||
4 | typedef int (^blocktype)(int a, int b); | ||||
5 | |||||
6 | @interface A { | ||||
7 | A* a; | ||||
8 | id b; | ||||
9 | Class c; | ||||
10 | } | ||||
11 | - (blocktype)Meth; | ||||
12 | @end | ||||
13 | |||||
14 | @implementation A | ||||
15 | - (blocktype)Meth { | ||||
16 | if (b) | ||||
17 | return (blocktype)b; | ||||
18 | else if (a) | ||||
19 | return (blocktype)a; // expected-error {{C-style cast from 'A *' to 'blocktype' (aka 'int (^)(int, int)') is not allowed}} | ||||
20 | else | ||||
21 | return (blocktype)c; | ||||
22 | } | ||||
23 | @end |