Add a polymorphic static assert when using an alias
An alias can be used for two main purposes: to override virtual methods,
and to add some extra data to a class needed for the pybind-wrapper.
Both of these absolutely require that the wrapped class be polymorphic
so that virtual dispatch and destruction, respectively, works.
diff --git a/tests/test_class.cpp b/tests/test_class.cpp
index 5860b74..670949f 100644
--- a/tests/test_class.cpp
+++ b/tests/test_class.cpp
@@ -231,7 +231,7 @@
bind_local<LocalExternal, 17>(m, "LocalExternal", py::module_local());
}
-template <int N> class BreaksBase {};
+template <int N> class BreaksBase { public: virtual ~BreaksBase() = default; };
template <int N> class BreaksTramp : public BreaksBase<N> {};
// These should all compile just fine:
typedef py::class_<BreaksBase<1>, std::unique_ptr<BreaksBase<1>>, BreaksTramp<1>> DoesntBreak1;