/* { dg-do run { target c++11 } } */ /* There is a devirtualizable call. In PR60306 we deduced wrong target to cxa_pure_virtual. For gcc 4.10 we temporarily disable the devirtualization. */ /* { dg-options "-O3" } */ #include using std::vector; class Object { public: virtual Object* clone() const =0; virtual int type() const {return 0;} Object& operator=(const Object&) {return *this;} Object() {} Object(const Object&) {} virtual ~Object() {} }; Object* f(const Object&o) { return o.clone(); } template class Box: public Object, public T { public: Box* clone() const {return new Box(*this);} Box& operator=(const Box& t) { T::operator=(t); return *this; } Box& operator=(const T& t) { T::operator=(t); return *this; } Box() = default; Box(const Box&) = default; explicit Box(const T& t):T(t) {} }; template using Vector = Box>; typedef Vector OVector; OVector edges_connecting_to_node(int n) { OVector branch_list_; for(int i=0;i