llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.76k stars 11.89k forks source link

Template parameter type deduction of function conflicts when parameter is a vector return value of builtin function #31649

Open llvmbot opened 7 years ago

llvmbot commented 7 years ago
Bugzilla Link 32302
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@zygoloid

Extended Description

cat a.C
template <class A>
A f(const A& a, const A& b){
return a+b;
}

int main(){
vector int a;
vector float b;
f(__builtin_altivec_vcfsx(a,0),b);
}
clang++ a.C -faltivec
a.C:9:1: error: no matching function for call to 'f'
f(__builtin_altivec_vcfsx(a,0),b);
^
a.C:2:3: note: candidate template ignored: deduced conflicting types for parameter 'A' ('__attribute__((__vector_size__(4 * sizeof(float)))) float'
      (vector of 4 'float' values) vs. '__vector float' (vector of 4 'float' values))
A f(const A& a, const A& b){
  ^
1 error generated.
llvmbot commented 3 months ago

@llvm/issue-subscribers-backend-powerpc

Author: None (llvmbot)

| | | | --- | --- | | Bugzilla Link | [32302](https://llvm.org/bz32302) | | Version | trunk | | OS | Linux | | Reporter | LLVM Bugzilla Contributor | | CC | @DougGregor,@zygoloid | ## Extended Description ``` cat a.C ``` ```cpp template <class A> A f(const A& a, const A& b){ return a+b; } int main(){ vector int a; vector float b; f(__builtin_altivec_vcfsx(a,0),b); } ``` ``` clang++ a.C -faltivec a.C:9:1: error: no matching function for call to 'f' f(__builtin_altivec_vcfsx(a,0),b); ^ a.C:2:3: note: candidate template ignored: deduced conflicting types for parameter 'A' ('__attribute__((__vector_size__(4 * sizeof(float)))) float' (vector of 4 'float' values) vs. '__vector float' (vector of 4 'float' values)) A f(const A& a, const A& b){ ^ 1 error generated. ```