http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56889

--- Comment #8 from Amali Praveena <amalisperid at yahoo dot com> 2013-04-12 
03:39:35 UTC ---
Hi reddit,
Yes, it's not a GCC bug.  I had a problem with copy constructors in version
4.7.0 but got Internal Compilation Error. I'm now working with GCC 4.8.0 in
which this is fixed. I think I got confused with this.
I thought of adding these delete functions to the abstract class and test it.
Since vector_stack doesn't have any pointer members/ members of its own, I can
rely on compiler to generate a default copy constructor for this more derived
class of Stack.
Option 1:
As you say, because I have made copy/move operations in the abstract
type(Stack) =delete, I think I should define a default copy
constructor/assignment and move constructor/assignment in all more derived
classes of Stack. 
Option 2:
Change the clone function. However, Clone pattern is often implemented using
copy constructor. Until now, I haven't seen it done in some other ways. 

Thanks,
Amali.


________________________________
 From: redi at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org>
To: amalispe...@yahoo.com 
Sent: Thursday, 11 April 2013 10:42 PM
Subject: [Bug c++/56889] =delete(ing) default copy and move operations for a
polymorphic type gives compilation error messages



http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56889

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-04-11
12:42:52 UTC ---
You keep quoting Stroustrup but your code is still broken.

Your clone() function copies the object. The object is not copyable.  What is
so difficult to understand?

Add a copy constructor to vector_stack or change the clone function.

This is not a GCC bug!

Reply via email to