[Bug libstdc++/81263] Work around CWG issue 1558 (guarantee SFINAE when using `void_t`)

rs2740 at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Jun 30 18:46:00 GMT 2017


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

TC <rs2740 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rs2740 at gmail dot com

--- Comment #2 from TC <rs2740 at gmail dot com> ---
This is not DR1558; the issue here is declaration matching rather than SFINAE.
Just having the two func definitions is sufficient to trigger the error:

template<class...> using void_t = void;

template <typename T, void_t<typename T::x>* = nullptr>
void func() {}
template <typename T, void_t<typename T::y>* = nullptr>
void func() {}

This is actually CWG 1980.


More information about the Gcc-bugs mailing list