AutosarC++17_10-A18.5.8

Objects that do not outlive a function shall have automatic storage duration

Required inputs: IR, StaticSemanticAnalysis

Possible Messages

Key

Text

Severity

Disabled

could_be_scoped

Local objects shall be allocated on the stack.

None

False

Options

allow_smart_ptr_from_function_return

allow_smart_ptr_from_function_return : bool = True

Whether to allow a smart pointer returned from a function as a local variable in a function. Calling the smart pointer constructors or the helper functions std::make_{shared,unique,..} will remain a violation.
 

consider_exceptional_exit

consider_exceptional_exit : bool = False

Whether leaving a function due to an exception should be considered as an exit, i.e., if objects that have not been deallocated on the path to the exceptional exit should be reported.
 

ignore_arrays

ignore_arrays : bool = False

Whether to ignore objects allocated using array new.