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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Further reduced:

template<bool B>
struct bool_constant { static constexpr bool value = B; };

template<typename From, typename To>
struct is_convertible
: public bool_constant<__is_convertible(From, To)>
{ };

class Private
{
  operator int() const;
};

static_assert( not is_convertible<Private, int>::value, "" );


sfinae.cc: In instantiation of 'struct is_convertible<Private, int>':
sfinae.cc:14:48:   required from here
sfinae.cc:6:24: error: 'Private::operator int() const' is private within this
context
    6 | : public bool_constant<__is_convertible(From, To)>
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
sfinae.cc:11:3: note: declared private here
   11 |   operator int() const;
      |   ^~~~~~~~
sfinae.cc:14:16: error: static assertion failed
   14 | static_assert( not is_convertible<Private, int>::value, "" );
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to