[cfe-dev] Declaring function prototype with typedef

Chris Lattner clattner at apple.com
Tue Nov 13 22:35:24 PST 2007


On Nov 13, 2007, at 5:41 PM, Sanghyeon Seo wrote:

> 2007/11/12, Sanghyeon Seo <sanxiyn at gmail.com>:
>> No patch this time. Sorry.
>
> Okay, here is a patch. Attached.
>
>> // RUN: clang -fsyntax-only -verify %s
>>
>> typedef int unary_int_func(int arg);
>> unary_int_func add_one;
>>
>> int add_one(int arg) {
>>    return arg + 1;
>> }

Your patch looks great!  I made one tweak to avoid calling  
GetTypeForDeclarator twice in the typedef case, otherwise I applied it  
unmodified:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20071112/002876.html

Thanks!

-Chris



More information about the cfe-dev mailing list