AutosarC++18_10-A12.1.3

If all user-defined constructors of a class initialize data members with constant values that are the same across all constructors, then data members shall be initialized using NSDMI instead

Required inputs: IR

Possible Messages

Key

Text

Severity

Disabled

use_nsdmi

Use NSDMI for common constant initializations ({}).

None

False

Options

allow_constructors_of_types

allow_constructors_of_types : set[bauhaus.analysis.config.QualifiedName] = set()

List of fully qualified type names which constructors are considered literals, without regard to the actual arguments.
 

allow_literal_like_constructors

allow_literal_like_constructors : bool = False

Whether to consider constructors that take only literals as arguments a literal. If set to true, this is checked recursively.
 

min_number_common_inits

min_number_common_inits : int = 1

Minimum number (inclusive) of common initializations to enforce use of NSDMI.