| 1 |
// PR c++/92745 - bogus error when initializing array of vectors. |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-options "-Wno-psabi -w" } |
| 4 |
|
| 5 |
template <typename a, int b> struct c { |
| 6 |
typedef a d[b]; |
| 7 |
}; |
| 8 |
|
| 9 |
template <typename a, int b> struct array { |
| 10 |
typename c<a, b>::d e; |
| 11 |
a operator[](long); |
| 12 |
}; |
| 13 |
|
| 14 |
template<class T> |
| 15 |
using vec4_t __attribute__((vector_size(4*sizeof(T)))) = float; |
| 16 |
|
| 17 |
array<vec4_t<float>, 4> |
| 18 |
transpose(array<vec4_t<float>, 4> col) |
| 19 |
{ |
| 20 |
array<vec4_t<float>, 4> |
| 21 |
ret{vec4_t<float>{col[0][0], col[1][0], col[2][0], col[3][0]}, |
| 22 |
vec4_t<float>{col[0][1], col[1][1], col[2][1], col[3][1]}, |
| 23 |
vec4_t<float>{col[0][2], col[1][2], col[2][2], col[3][2]}, |
| 24 |
vec4_t<float>{col[0][3], col[1][3], col[2][3], col[3][3]}}; |
| 25 |
return ret; |
| 26 |
} |