[cfe-dev] const stripped in typedefs for parameters of primitive type?

Jacob Carlborg doob at me.com
Sun Aug 24 23:49:30 PDT 2014


On 24/08/14 23:42, David Blaikie wrote:

> Try writing these two functions in one file:
>
>    void func(int) {}
>    void func(const int) {}
>
> And it won't compile (but if you add * yo each parameter it will)
> because the functions have the same type.

I understand that the const doesn't matter in this case. But what I 
don't understand is why libclang will say that in the function above the 
parameter is const. But if I use a typedef it will not be const.

-- 
/Jacob Carlborg




More information about the cfe-dev mailing list