Affected rules
M5-3-1
A5-0-2
cpp/autosar/non-boolean-if-condition
cpp/autosar/non-boolean-iteration-condition
Description
Iteration or if statements of type bool within uninstantiated templates have an unknown type and raise a false positive.
Example
template<T>
void foo(std::vector<T> & v) {
for (typename std::vector<T>::iterator it{v.begin()}; it != v.end(); ++it) {
(*it)++;
}
}
Affected rules
M5-3-1A5-0-2cpp/autosar/non-boolean-if-conditioncpp/autosar/non-boolean-iteration-conditionDescription
Iteration or if statements of type
boolwithin uninstantiated templates have anunknowntype and raise a false positive.Example