List of C/C++ inspections
Data flow analysis
Analyzes method control and data flow to report conditions that are always true or false and expressions with statically constant values.
|Constant function result|
Detects functions whose return value is always equal to the same constant.
Detects functions where a parameter is always equal to the same constant.
Detects pointers that point to invalid data, typical cases are double-free and use-after-free problems. Check out this parent ticket for the list of limitations.
Detects when a function produces infinite recursion.
|Local value escapes scope|
Detects variables that reference local values that escape their scope.
|Loop condition isn't updated inside the loop|
Detects situations where a loop condition is not updated inside the loop, which can cause an infinite loop.
There is a similar inspection in Clang-Tidy,
Detects dereferences of pointers that may contain the
|Unreachable calls of function|
Detects functions whose call sites are never executed.
Detects the code that is never executed (dead code).
|Unused local variable||Detects the variables that are declared but not used and never accessed for reading.||Warning|
|Unused parameter||Detects the parameters that are declared but not used and never accessed for reading.||Warning|
Reports the cases when the value of a variable is never used after the assignment.
Clear the Warn about unused variable initializers checkbox to disable the inspection for default variable initializers (for example, if you prefer to assign
|Hiding non-virtual function|
Reports when a function hides non-virtual functions with the same signature from the base class.
|Not implemented functions|
Detects when a function is declared but not defined.
|Argument selection defect|
Compares the names of arguments in a call and formal parameter names in the declaration to detect the errors like accidental switching of the arguments.
See Inspection: Argument selection defects for details.
|Clangd errors and warnings||Reports errors and warnings from Clangd. This inspection works in the editor as you type, and you can also get a summary of the results when running inspections manually using .|
|Empty declaration or statement|
Reports the redundant empty declarations and statements that can be safely removed.
Reports when a symbol violates the currently selected naming convention.
Find more details in Inspecting code for violations of the naming rules.
|Preprocessor directive comment|
Finds cases where a preprocessor
Suggests to simplify the following types of statements:
|Unconstrained variable type|
Suggests constraining local variables declared as
This inspection is disabled by default on Windows and is not supported for concepts declared with the
|Virtual call from constructor or destructor|
Reports when a virtual function is called from a constructor or destructor, helping to prevent situations when virtual functions access the resources that are not yet initialized or have already been destroyed.
Static Analysis Tools
Performs various clang-tidy checks related to C++ Core Guidelines, code modernization, readability, and performance issues.
See Clang-Tidy integration for details.
Performs Qt-related clazy checks.
You can adjust the list of checks in the Options section.
Note that on Windows with MSVC (including the case of clang-cl), CLion shows only the MISRA C++ checks. MISRA C checks can't be shown correctly because they apply to a specific language standard configurable via the
Detects C++ concepts that are never used.
|Unused global declaration|
Detects when a global function or variable is declared but never accessed or written.
|Unused include directive|
Reports the unused or unrequired
See Inspection: Unused include directive for details.
Detects macro definitions that are never used in the code.
Detects C/C++ classes and structures that are never used.
|Unused template parameter|
Detects C++ class and function template parameters that are never used.
|Unused type alias||Reports |