Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -verify -pedantic |
Chris Lattner | bfe639e | 2008-01-03 22:56:36 +0000 | [diff] [blame] | 2 | typedef int unary_int_func(int arg); |
| 3 | unary_int_func *func; |
| 4 | |
| 5 | unary_int_func *set_func(void *p) { |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 6 | func = p; // expected-warning {{converts between void pointer and function pointer}} |
| 7 | p = func; // expected-warning {{converts between void pointer and function pointer}} |
Chris Lattner | bfe639e | 2008-01-03 22:56:36 +0000 | [diff] [blame] | 8 | |
Douglas Gregor | d4eea83 | 2010-04-09 00:35:39 +0000 | [diff] [blame] | 9 | return p; // expected-warning {{converts between void pointer and function pointer}} |
Chris Lattner | bfe639e | 2008-01-03 22:56:36 +0000 | [diff] [blame] | 10 | } |
| 11 | |