AutosarC++19_03-A12.8.5

A copy assignment and a move assignment operator shall handle self-assignment

Required inputs: IR

Possible Messages

Key

Text

Severity

Disabled

incomplete_swap

Swap does not handle all non-static data members.

None

False

self_assignment

Missing or non-compliant guard against self-assignment.

None

False

Options

allowed_comparison_operators

allowed_comparison_operators : set[bauhaus.ir.PIR_Class_Name] = {'Equal', 'Unequal'}

Operators allowed for comparing this-pointer to the pointer referencing the object to be copied or moved from.
 

self_assignment_check_must_be_first_statement

self_assignment_check_must_be_first_statement : bool = False

If true, the self-assignment check must be the first statement in the operator definition. Otherwise, statements not causing self-assignment issues (e.g., empty statements or declarations without initializations) will be allowed before the self-assignment check.