AutosarC++18_03-M7.5.2

The address of an object with automatic storage shall not be assigned to another object that may persist after the first object has ceased to exist

Required inputs: IR

This rule will detect when a reference or pointer to a local variable is assigned to a non-local object. Because the non-local object will usually outlive the local variable, the reference or pointer will be dangling, and any access will cause a use-after-free error.
See Also
Rule GeneralPurpose-ReferenceToLocalVariable

Note

For legal reasons, this rule’s description is not part of the public documentation.