This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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; // !!

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]