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

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> ---
There is a funny work around for this though ...

#include <cstdint>

struct bswapped16
{
  const uint16_t val;
  constexpr bswapped16 (uint16_t v) : val (__builtin_bswap16 (v)) { }
};

constexpr uint16_t bswap16 (uint16_t x)
{
  return bswapped16 (x).val;
}

enum { foo_4 = bswap16 (1) };  // OK

Reply via email to