Closed
Description
Affected rules
- M0-1-3
Description
Local variables that are used are reported as unused. Please refer to the example for the sample scenarios.
Example
int foo()
{
constexpr int arrayDim=10; // 'arrayDim' reported unused
static int array[arrayDim] {}; // 'arrayDim' is used here
return array[4];
}
template<typename T>
static T template_function()
{
return T();
}
template<typename T, typename First, typename... Rest>
static T template_function(const First& first, const Rest&... rest) // 'rest' reported unused
{
return first + template_function<T>(rest...); // 'rest' is used here
}
static int templ_fnc2() {
return template_function<int>(1, 2, 3, 4, 5);
}
int main()
{
return 0;
}