[Bug lto/83997] ICE with alias template and attribute
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jan 26 11:20:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83997
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It is actually much worse than just some ICE with -flto.
template<int N>
using T = int __attribute__((vector_size (sizeof(int) * N)));
T<4> q;
template<int N>
int r __attribute__((vector_size (sizeof(int) * N)));
void *s = &r<4>;
T<4>
foo (T<4> a)
{
return a + 1;
}
decltype (r<4>)
bar (decltype (r<4>) a)
{
return a + 1;
}
shows that when using the T<4> we treat it as normal int, so sizeof (q) is
sizeof (int) and foo just adds to int argument 1 and returns that as int.
Compare that to the r case which is handled right.
More information about the Gcc-bugs
mailing list