MantisBT - Open CASCADE
View Issue Details
0025620Open CASCADE[OCCT] OCCT:Codingpublic2014-12-16 17:552019-07-10 19:27
[OCCT] 6.7.0 
[OCCT] 7.5.0* 
0025620: CAST analysis: Avoid public or missing copy assignment operator in abstract classes
The copy assignment operator lets you create a new object from an existing object through initialization. A copy assignment operator of a class A is a non-static, non-template member function that has one of the following forms:

    * A::operator=(A)
    * A::operator=(A&)
    * A::operator=(const A&)
    * A::operator=(volatile A&)
    * A::operator=(const volatile A&)

If you do not declare a copy assignment operator for a class A, the compiler will implicitly declare one for you which will be inline public.

Assignment operators using pointers are also taken into account:

    * A::operator=(A*)
    * A::operator=(const A*)
    * A::operator=(volatile A*)
    * A::operator=(const volatile A*)

By ensuring that the copy assignment operator is protected, it can only be, and should only be, called by the assignment operator of the derived class.
It is necessary to move assignment operator in protected section in Standard_Transient class.

More details: CAST report, issue 7926
No tags attached.
Issue History
2014-12-16 17:55aznNew Issue
2014-12-16 17:55aznAssigned To => azn
2015-04-21 06:08abvTarget Version6.9.0 => 7.1.0
2016-11-01 06:41abvTarget Version7.1.0 => 7.2.0
2017-07-20 12:26kgvAssigned Toazn =>
2017-07-20 12:26kgvTarget Version7.2.0 => 7.4.0
2019-07-10 19:27abvTarget Version7.4.0 => 7.5.0*

There are no notes attached to this issue.