[Bug c++/83003] Using the detection idiom and void_t causes an error

ensadc at mailnesia dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 16 13:22:00 GMT 2017


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

ensadc at mailnesia dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ensadc at mailnesia dot com

--- Comment #3 from ensadc at mailnesia dot com ---
There doesn't even need to be a specialization of Zod.

template <template <class> class, class = void>
struct dtect1  { enum { value = 0 }; };

template <template <class> class TT>
struct dtect1<TT, decltype(TT<int>{}, void())> { enum { value = 1 }; };

template <class T> struct Zod { };
template <class T> using Zod_t = typename Zod<T>::type;

static_assert(!dtect1<Zod_t>::value, "");

Zod_t<int> z2; // !!


More information about the Gcc-bugs mailing list