Re: [PATCH 2/3] enum_flags: Fix problems and add comprehensive unit tests

Simon Marchi
2016-11-05T03:05:45Z

On 2016-11-03 23:22, Pedro Alves wrote:
> +/* The (real) enum types used in CHECK_VALID. Their names match the
> + template parameter names of the templated defined by CHECK_VALID
> + just matching real vs template param type more obvious. They could
> + be named differently. */

I think something is not right with the second sentence.

> +/* Invalid since each type can be converted to the other. */
> +/* GCC 4.8 incorrectly fails to compile this test with:
> + error: operands to ?: have different types ‘enum_flags<RE>’ and
> ‘RE’
> + Confirmed to compile/pass with gcc 4.9, 5.3 and clang 3.7.
> +*/
> +#if GCC_VERSION >= 4009

Does this #if enables testing with clang?

> +CHECK_VALID (false, void, true ? EF () : RE ())
> +CHECK_VALID (false, void, true ? RE () : EF ())
> +#endif