MISRA C++:2023 Rule 6.9.1
The same type aliases shall be used in all declarations of the same entity
Since R2024b
Description
Rule Definition
The same type aliases shall be used in all declarations of the same entity.
Rationale
If a redeclaration uses different type aliases than the original declaration, then it is not clear that the two declaration refers to the same entity. To avoid confusion, use same type aliases when redeclaring an entity.
Polyspace Implementation
The rule checker compares the current declaration with the last seen declaration and
reports a violation if the two declarations are not compatible. Differences in qualifiers
such as const
are not reported as violations of this rule.
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: Basic Concepts |
Category: Required |
Version History
Introduced in R2024b