]> granicus.if.org Git - clang/commit
[Clang][Sema]Choose a better candidate in overload function call if there is a compat...
authorZi Xuan Wu <wuzish@cn.ibm.com>
Fri, 16 Nov 2018 03:00:00 +0000 (03:00 +0000)
committerZi Xuan Wu <wuzish@cn.ibm.com>
Fri, 16 Nov 2018 03:00:00 +0000 (03:00 +0000)
commitfbbf9d4aee2f9dae4253180be19ceb7a271af65f
tree7f6b8df83c6bc7b70bccb52dd6a368e07605e61b
parent30a86941b0515629cdac77d4ef8078422e6fe706
[Clang][Sema]Choose a better candidate in overload function call if there is a compatible vector conversion instead of ambiguous call error

There are 2 function variations with vector type parameter. When we call them with argument of different vector type we would prefer to
choose the variation with implicit argument conversion of compatible vector type instead of incompatible vector type. For example,

typedef float __v4sf __attribute__((__vector_size__(16)));
void f(vector float);
void f(vector signed int);

int main {
   __v4sf a;
   f(a);
}

Here, we'd like to choose f(vector float) but not report an ambiguous call error.

Differential revision: https://reviews.llvm.org/D53417

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347019 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaOverload.cpp
test/Sema/altivec-generic-overload.c [new file with mode: 0644]
test/SemaCXX/vector.cpp