[PATCH] D24113: Allow implicit conversions between incompatible pointer types in overload resolution in C.

Jan Vesely via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 6 22:03:29 PDT 2016


jvesely added a comment.

In https://reviews.llvm.org/D24113#535255, @george.burgess.iv wrote:

> Thanks for the heads-up!
>
> I'm assuming that below is an example of code that this patch broke?
>
>   void foo(int *a, int) __attribute__((overloadable));
>   void foo(unsigned int *a, unsigned int) __attribute__((overloadable));
>  
>   void callFoo() {
>     unsigned int i;
>     foo(&i, 0u); // fine.
>     foo(&i, 0); // now-ambiguous overload.
>   }
>


yes, you're correct. (I'm pretty sure I tried this before posting, I must have done something wrong...) I'll send libclc patch. The specs don't really talk about overloads so I think the behaviour is OK. Although I think that users will expect atomic_add(unsigned int *, 5) to work.without error.

thanks


Repository:
  rL LLVM

https://reviews.llvm.org/D24113





More information about the cfe-commits mailing list