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

--- Comment #2 from Fedor Chelnokov <fchelnokov at gmail dot com> ---
Another aspect is that the order of destructors in the class change its
behavior:

#include <type_traits>

template<int N>
struct X {
  ~X() requires (N==1);
  virtual ~X();
};

// X is NOT polymorphic in GCC
static_assert( !std::is_polymorphic_v<X<1>> );

template<int N>
struct Y {
  virtual ~Y();
  ~Y() requires (N==1);
};

// Y is polymorphic in GCC
static_assert( std::is_polymorphic_v<Y<1>> );

Demo: https://gcc.godbolt.org/z/493qr5K9d

Reply via email to