http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59633

--- Comment #2 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
> What makes you think the code is valid? From the doc, I think this should be
> rejected (with a proper error message).

Well, because the C-frontend compiles it, the C++-frontend used to compile it
and even clang (3.2) compiles it, I was under the impression that this should
compile (using the underlying type of the enum).

OTOH, bool is rejected, so enums could be rejected as well.
This would avoid the trouble of underlying types and (even more important)
the missing arithmetic operations.

About the docs: I'm not sure which docs you are referring to, but I don't
think the wording in gcc.info (6.49 Using Vector Instructions through Built-in
Functions) prohibits enums (it doesn't mention them explicitly):

> The `vector_size' attribute is only applicable to integral and float
> scalars, although arrays, pointers, and function return values are
> allowed in conjunction with this construct. Only sizes that are a power
> of two are currently allowed.

IMHO enums are integral scalars.

> All the basic integer types can be used as base types, both as signed
> and as unsigned: `char', `short', `int', `long', `long long'.  In
> addition, `float' and `double' can be used to build floating-point
> vector types.

It's not clear whether this list is exhaustive or not.
And of course, the docs are at least incomplete, if not inaccurate.
E.g. the vector extension of the ternary operator ?: is missing in this
chapter.

Reply via email to