View Issue Details

IDProjectCategoryView StatusLast Update
0025617Open CASCADEOCCT:Codingpublic2016-04-20 15:48
ReporteraznAssigned Tokgv  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.7.0 
Target Version7.0.0Fixed in Version7.0.0 
Summary0025617: Avoid classes with a copy constructor and the default destructor or assignment operator
DescriptionIf you need a copy constructor, you also need a destructor and 'operator='. If you need a copy constructor, 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 assignment operator.
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 contain a problem:
- Graphic3d_Vertex
- LDOM_Attr
- LDOM_CDATASection
- LDOM_Comment
- LDOM_Element
- LDOM_Text
- LDOMString
- NCollection_Mat4
- NCollection_StdAllocator
- NCollection_Vec2
- NCollection_Vec3
- NCollection_Vec4
- BOPCol_NCVector
- NCollection_BaseVector (::Iterator)
- NCollection_StdAllocator (assignment operator)
- NCollection_Vector
- Prs3d_DimensionUnits
- VrmlData_DataMapOfShapeAppearance

TagsNo tags attached.
Test case number

Relationships

related to 0025571 closedkgv Avoid base Classes without virtual Destructors 
related to 0025618 closedkgv Avoid classes with an assignment operator and not implementing both a destructor and a copy constructor 

Activities

azn

2014-12-18 15:31

developer   ~0035480

Branch CR25571 is a ready to be reviewed.

Related Changesets

occt: master 9533a866

2014-12-17 08:17:28

azn


Committer: kgv Details Diff
0025617: Avoid classes with a copy constructor and the default destructor or assignment operator

Removed useless user-defined copy constructors and assignment operators in BOPCol_NCVector, NCollection_Mat4, NCollection_Vec*

User-defined assignment operator matching copy constructor added in NCollection_StdAllocator.

Class VrmlData_DataMapOfShapeAppearance redefined as simple typedef to NCollection_DataMap<>.
Affected Issues
0025617
mod - src/BOPCol/BOPCol_NCVector.hxx Diff File
mod - src/NCollection/NCollection_Mat4.hxx Diff File
mod - src/NCollection/NCollection_StdAllocator.hxx Diff File
mod - src/NCollection/NCollection_Vec2.hxx Diff File
mod - src/NCollection/NCollection_Vec3.hxx Diff File
mod - src/NCollection/NCollection_Vec4.hxx Diff File
mod - src/VrmlData/VrmlData_DataMapOfShapeAppearance.hxx Diff File
mod - src/VrmlData/VrmlData_Group.hxx Diff File
mod - src/VrmlData/VrmlData_Scene.hxx Diff File

Issue History

Date Modified Username Field Change
2014-12-16 17:35 azn New Issue
2014-12-16 17:35 azn Assigned To => kgv
2014-12-16 17:38 azn Assigned To kgv => azn
2014-12-18 15:28 azn Relationship added related to 0025618
2014-12-18 15:31 azn Note Added: 0035480
2014-12-18 15:31 azn Assigned To azn => kgv
2014-12-18 15:31 azn Status new => resolved
2014-12-18 15:31 azn Steps to Reproduce Updated
2014-12-18 15:31 azn Relationship added related to 0025571
2014-12-18 15:36 azn Assigned To kgv => azn
2014-12-18 15:37 azn Assigned To azn => abv
2015-04-21 06:08 abv Target Version 6.9.0 => 7.1.0
2015-09-28 12:58 kgv Changeset attached => occt master 9533a866
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