MISRA C++:2008 Rule 0-1-5
A project shall not contain unused type declarations
Description
Rule Definition
A project shall not contain unused type declarations.
Rationale
If you declare a type but do not use it, determining if the type is redundant or left unused by mistake is difficult when you review your code.
For example, if you declare an enumerated data type to store some specialized data, but then use an integer type to store the data, the unused type can indicate a coding error.
Polyspace Implementation
Polyspace® reports a violation of this rule if your code contains unused local types.
As an exception, Polyspace does not report a violation if you define the unused type with
public
access in a template class.
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: Language Independent Issues |
Category: Required |