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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Standalone testcase that compiles as C++11 or C++14, fails as C++17:

struct true_type { static constexpr bool value = true; };
struct false_type { static constexpr bool value = false; };
template<typename...> using void_t = void;
template<typename T> T&& declval();

template<typename T, typename U, typename = void>
struct is_nonnarrowing_conversion : false_type {};

template<typename T, typename U>
struct is_nonnarrowing_conversion<T, U,
    void_t<decltype(T{ declval<U>() })>> : true_type {};

template<typename T>
class wrapper
{
public:
    wrapper(T) {}
};

static_assert(!is_nonnarrowing_conversion<int, float>::value, "");
static_assert(!is_nonnarrowing_conversion<wrapper<int>, float>::value, "");

Reply via email to