MISRA C++:2008 Rule 14-6-1
In a class template with a dependent base, any name that may be found in that dependent base shall be referred to using a qualified-id or this->
Description
Rule Definition
In a class template with a dependent base, any name that may be found in that dependent base shall be referred to using a qualified-id or this->
Rationale
When a class template derives from another class template, there might be confusion
arising from the use of names that exist in both the base template and the current scope or
namespace. When the same name exists in the base class template and a namespace that
contains the classes, the scope resolution of these names is dependent on the compiler,
which might be contrary to developer's expectation. To avoid confusion, use fully qualified
id or this->
to explicitly disambiguate the intended object when such
a name conflict exists.
Polyspace Implementation
Polyspace® flags names for which all of these conditions are true:
The name exists in the base class.
The name exists in a namespace that contains the base class.
The name is used without qualified id or
this->
.
Troubleshooting
If you expect a rule violation but Polyspace does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Templates |
Category: Required |
Version History
Introduced in R2013b