Qt-RuleOfThree¶
Implements the rule of three
Required inputs: IR
- the class has a
QSharedDataPointermember - the class inherits from
QSharedData - if only the destructor is implemented and it is protected
- the class name ends with "Private"
- the class was created via the macro
Q_GLOBAL_STATIC_INTERNAL
This rule is based on clazy rule rule-of-three
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
missing_constructor_and_asgn |
Class with destructor should also declare a copy or move constructor and assignment operator. |
None |
False |
missing_copy_asgn |
Class with copy constructor is missing copy assignment operator. |
None |
False |
missing_copy_constructor |
Class with copy assignment operator is missing copy constructor. |
None |
False |
missing_destructor |
Class with copy or move constructors or assignment operators should also declare a destructor. |
None |
False |
missing_move_asgn |
Class with move constructor is missing move assignment operator. |
None |
False |
missing_move_constructor |
Class with move assignment operator is missing move constructor. |
None |
False |
Options¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
allow_defaulted_destructor_only¶
allow_defaulted_destructor_only : bool = True
allow_destructor_only¶
allow_destructor_only : bool = False
allow_empty_destructor¶
allow_empty_destructor : bool = True
allow_missing_destructor¶
allow_missing_destructor : bool = False
allow_protected_destructor_only¶
allow_protected_destructor_only : bool = True
ignore_classes_ending_with_string¶
ignore_classes_ending_with_string : set[str] = {'Private'}
ignore_classes_inheriting_from¶
ignore_classes_inheriting_from : set[bauhaus.analysis.config.QualifiedName] = {'QSharedData'}
ignore_classes_with_member_type¶
ignore_classes_with_member_type : set[bauhaus.analysis.config.QualifiedName] = {'QSharedDataPointer'}
ignore_macro_expanded_classes¶
ignore_macro_expanded_classes : set[bauhaus.analysis.config.MacroName] = {'Q_GLOBAL_STATIC_INTERNAL'}
ignore_pod_classes¶
ignore_pod_classes : bool = True
level¶
level : int = 2