View Issue Details

IDProjectCategoryView StatusLast Update
0025618Open CASCADEOCCT:Codingpublic2016-04-20 15:48
ReporteraznAssigned Tokgv  
Status closedResolutionfixed 
Product Version6.7.0 
Target Version7.0.0Fixed in Version7.0.0 
Summary0025618: Avoid classes with an assignment operator and not implementing both a destructor and a copy constructor
DescriptionIf you need an operator= , you also need a destructor and a copy constructor.
If you need an assignment operator, it's because you need something like a deep copy, or some other management of resources. Thus it is almost certain that you will need a destructor and override the copy constructor.
Steps To Reproducenot applicable
Additional information
and documentation updates
According to the CAST report in most cases the problem is associated to DEFINE_STANDARD_HANDLECLASS. It is necessary to add empty virtual destructor in DEFINE_STANDARD_HANDLECLASS macros to avoid this problem.

The following classes have problem:
- IntPolyh_StartPoint
- Quantity_Color
TagsNo tags attached.
Test case number


related to 0025617 closedkgv Avoid classes with a copy constructor and the default destructor or assignment operator 
related to 0025571 closedkgv Avoid base Classes without virtual Destructors 



2014-12-18 15:30

developer   ~0035479

Branch CR25571 is a ready to be reviewed.

Related Changesets

occt: master 4dff6a1b

2014-12-17 08:06:13


Committer: kgv Details Diff
0025618: Avoid classes with an assignment operator and not implementing both a destructor and a copy constructor

User-defined assignment operator is removed in the classes IntPolyh_StartPoint and Quantity_Color, as default assignment will be OK
Affected Issues
mod - src/IntPolyh/IntPolyh_StartPoint.cxx Diff File
mod - src/IntPolyh/IntPolyh_StartPoint.hxx Diff File
mod - src/Quantity/Quantity_Color.cxx Diff File
mod - src/Quantity/Quantity_Color.hxx Diff File

Issue History

Date Modified Username Field Change
2014-12-16 17:40 azn New Issue
2014-12-16 17:40 azn Assigned To => azn
2014-12-18 15:28 azn Relationship added related to 0025617
2014-12-18 15:30 azn Note Added: 0035479
2014-12-18 15:30 azn Assigned To azn => abv
2014-12-18 15:30 azn Status new => resolved
2014-12-18 15:30 azn Steps to Reproduce Updated
2014-12-18 15:31 azn Relationship added related to 0025571
2015-04-21 06:08 abv Target Version 6.9.0 => 7.1.0
2015-09-28 12:58 kgv Changeset attached => occt master 4dff6a1b
2015-09-28 12:58 kgv Assigned To abv => kgv
2015-09-28 12:58 kgv Status resolved => verified
2015-09-28 12:58 kgv Resolution open => fixed
2015-09-29 08:55 abv Target Version 7.1.0 => 7.0.0
2016-04-20 15:44 aiv Fixed in Version => 7.0.0
2016-04-20 15:48 aiv Status verified => closed