Closed
Description
Affected rules
M7-3-6
Description
The rule states:
using-directives and using-declarations (excluding class scope or function scope using-declarations) shall not be used in header files.
However, we currently permit both using declarations and using directives in function/class scope - we should refine this.
In addition, some using
directives/declarations appear to be "orphaned" in our model - i.e. be located within a function or class, but with a fake parent which is not otherwise connected to the AST. We should exclude these to avoid false positives.
Example
template<typename T>
void foo(T& t){
using some_namespace::func; // COMPLIANT[FALSE_POSITIVE] - not directly reproducible today
func(t);
}
template<typename T>
class base{
protected:
void foo(T);
};
template<typename T>
class derived: base<T> {
public:
using base::foo; // COMPLIANT[FALSE_POSITIVE]
void foo(T,T);
};