AutosarC++17_10-M2.10.6¶
If an identifier refers to a type, it shall not also refer to an object or a function in the same scope
Required inputs: IR
| Level | required |
|---|---|
| Target | implementation |
| Enforcement | automated |
Rationale
For C compatibility, it is possible in C++ for a name to refer to both a type and object or a type and function. This can lead to confusion.
Example
typedef struct vector { uint16_t x ; uint16_t y; uint16_t z; } vector;
// Non-compliant ^^ Non-compliant ^^
struct vector { uint16_t x ; uint16_t y; uint16_t z; } vector;
// Non-compliant ^^ Non-compliant ^^
Note
For legal reasons, this rule’s description is not part of the public documentation.