Miscellaneous-MissingConstructorΒΆ

Each class needs an explicitly declared constructor

Required inputs: IR

If a class does not have an explicitly declared constructor, the C++ compiler will generate a default constructor. The compiler-generated default constructor will leave POD fields uninitialized, which may cause undefined behavior if the class is used without proper initialization.
See Also
Rule GeneralPurpose-InitializeAllFieldsInConstructor ensures that constructors do not leave fields uninitialized.

Possible Messages

Key

Text

Severity

Disabled

missing_constructor

Class does not have an explicitly declared constructor.

None

False

Options