[Bug c++/83003] Using the detection idiom and void_t causes an error
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 15 14:38:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83003
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-11-15
Ever confirmed|0 |1
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced:
template <template <class> class, class, class = void>
struct dtect1 { enum { value = 0 }; };
template <template <class> class TT, class T>
struct dtect1<TT, T, decltype(TT<T>{}, void())> { enum { value = 1 }; };
template <class T> struct Zod { using type = double; };
template <> struct Zod<int> { };
template <class T> using Zod_t = typename Zod<T>::type;
static_assert(!dtect1<Zod_t,int>::value, ""); // (1)
Zod_t<float> z1; // a double
Zod_t<int> z2; // !!
More information about the Gcc-bugs
mailing list