AUTOSAR C++14 Rule M7-3-6
Using-directives and using-declarations (excluding class scope or function scope using-declarations) shall not be used in header files
Description
Rule Definition
using-directives and using-declarations (excluding class scope or function scope using-declarations) shall not be used in header files.
Rationale
If using
directives or declarations are present in a header file, the order in which the header is included might affect the final program results. It is a good practice to ensure that the program behavior does not depend on the order of inclusion of headers.
Polyspace Implementation
The checker flags using
directives or declarations in header files.
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: Declaration |
Category: Required, Automated |
Version History
Introduced in R2019a