Why does gcc warn about calling a non-trivial move assignment operator with std::tuple and virtual inheritance?
问题 In the following example gcc 7 gives a warning: defaulted move assignment for 'B' calls a non-trivial move assignment operator for virtual base 'A' [-Wvirtual-move-assign] if I create an std::tuple<B> object. Clang 5 doesn't report any problems. Also the problem goes away if vector is removed from Base . Example. #include <tuple> #include <vector> class Base { public: virtual ~Base(); std::vector<int> v; }; class A : public Base { }; class B : public virtual A { }; int main() { B *b = new B;