https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116666

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
<stdin>: In instantiation of ‘struct glsl::VectorType<__vector(4) int, 4>’:
<stdin>:577:63:   required from here
<stdin>:106:13: error: invalid vector type for attribute ‘vector_size’
<stdin>:108:22: error: invalid vector type for attribute ‘vector_size’
<stdin>:110:13: error: invalid vector type for attribute ‘vector_size’

Agreed.  It looks like the code is trying to apply the vector_size attribute to
an already vector type.  Before r15-2331 we would prematurely strip the
vector_size attribute on the dependent alias when used as a template argument
for a dependent specialization, even though it affects the identity of the
type, so VectorType<mask_type, N> is equivalent to VectorType<mask_index, N>. 
Now we don't, which AFAICT is the more desirable/consistent behavior.

Though I wonder why Clang accepts the testcase given that it also rejects
applying vector_size to a vector type directly:

template<class T>
struct X {
  typedef T A __attribute__((vector_size(16)));
  typedef A B __attribute__((vector_size(16))); // error
};

template struct X<int>;

Reply via email to