AutosarC++18_03-A3.3.2

Static and thread-local objects shall be constant-initialized

Required inputs: IR

Possible Messages

Key

Text

Severity

Disabled

constexpr_init_variable

Static and thread-local objects shall be constant-initialized.

None

False

Options

allowed_effects

allowed_effects

Type: set[SimpleEffect] | None

Default: None

If set, static and thread-local objects may also be initialized with a non-constexpr function/constructor call that only has the specified side-effects. If set, a writing side-effect to the object in question will be allowed additionally.
 

Option Types

These types are used by options listed above:

SimpleEffect

This enum is a simplified representation of the effects. It's used by stylecheck rules as `Set[SimpleEffect]` to allow the user to configure additional allowed effects.
 

alloc_free

Memory allocations (malloc, free, new, delete).

volatile

Accessing volatile memory.

atomic

Atomic access; also used for inter-thread memory barriers.

unknown_code

The "Unknown Code" effect appears when calling a function that has no definition in the IR.

exceptions

Throwing C++ exceptions.

optimizer_hint

Optimizer hints without semantic effect. Examples are '__builtin_assume' or '__builtin_unreachable'.