Qt-RangeLoopReference¶
Finds places where you’re using C++11 range-loops with non-trivial types by value
Required inputs: IR
Fix it by adding a missing const-& or & (if the range
declaration is already const).
Example
for (const auto &i : list) { ... }
The notion of "trivial" here is slightly weaker than "C++ trivially copyable". Assignment operators and move-ctors are disregarded. A "non-trivial" type in this sense has at least one non-trivial copy-ctor or dtor and thus is also no "C++ trivial class"
This rule is based on clazy rule range-loop-reference
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
range_loop_reference |
Missing{} reference in range-for with non-trivial 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 = 1