Qt-RuleOfTwoSoft¶
A trivial copy constructor or copy assignment operator is called despite non-trivial counter parts
Required inputs: IR
- You are calling a trivial copy constructor of a class which has a non-trivial copy assignment operator
- You are calling a trivial copy assignment operator of a class which has a non-trivial copy constructor
Beware that removing copy constructors or copy assignment operators might make the class trivially copyable, which is not ABI compatible.
This rule is based on clazy rule rule-of-two-soft
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
using_assignment_operator |
Using trivial copy assignment operator but class {} has non-trivial copy constructor. |
None |
False |
using_copy_constructor |
Using trivial copy constructor but class {} has non-trivial copy assignment operator. |
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
collect_usages¶
collect_usages : bool = False
level¶
level : int = 1