We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22e1de1 commit 1cae92eCopy full SHA for 1cae92e
1 file changed
include/rice/rice.hpp
@@ -10283,8 +10283,9 @@ namespace Rice::detail
10283
if constexpr (is_complete_v<T>)
10284
{
10285
// is_abstract_v requires a complete type, so nest inside is_complete_v.
10286
- // Deleting an abstract class through a non-virtual destructor is UB.
10287
- if constexpr (std::is_destructible_v<T> && !std::is_abstract_v<T>)
+ // Deleting an abstract class through a non-virtual destructor is UB,
+ // but it is safe if the destructor is virtual.
10288
+ if constexpr (std::is_destructible_v<T> && (!std::is_abstract_v<T> || std::has_virtual_destructor_v<T>))
10289
10290
if (this->isOwner_)
10291
0 commit comments