Qt-WrongQGlobalStatic¶
Finds Q_GLOBAL_STATICs being used with trivial types
Required inputs: IR
Using Q_GLOBAL_STATIC with trivial types is
unnecessary and creates code bloat. Trivial types are non-class types
or class types that are trivially default constructible.
Example:
struct Trivial
{
int v;
};
Q_GLOBAL_STATIC(Trivial, t); // Wrong
static Trivial t; // Correct
This rule is based on clazy rule wrong-qglobalstatic
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
wrong_qglobalstatic |
Do not use Q_GLOBAL_STATIC with {} type. |
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
level¶
level : int = 0