Closed
Description
Affected rules
- M14-6-1
Description
There are three issues with this rule:
The rule is "In a class template with a dependent base,...", however, the rule is not restricted to template classes.Edit: although the query doesn't include an explicit condition, the nature of the problem is that it only can occur where the base type is a dependent template type. This just needs some additional documentation in the query, and some additional test cases.- There is a performance problem in the way that we try to find function calls, function accesses and variable accesses in the sub-type which conflict with a name in the super-type. This is because we are trying to find pairs of functions with the same name, and our join ordering is not ideal.
- We are missing the types case.
Example
Templates:
class B {
public:
void g();
};
class A : B {
public:
void m1() {
g(); // COMPLIANT[FALSE_POSITIVE] - not a template class
}
};
Missing type support:
template <typename T> class B {
public:
typedef T TYPE;
};
template <typename T> class A : B<T> {
public:
void m1() {
TYPE t = 0; // NON_COMPLIANT[FALSE_NEGATIVE]
}
};
``