@@ -74,25 +74,32 @@ private IntegralType stlr(Expr const) {
74
74
}
75
75
76
76
/**
77
- * Define the essential type category for an IntegralOrEnumType .
77
+ * Define the essential type category for an essentialType or a typedef of an essentialType .
78
78
*/
79
- EssentialTypeCategory getEssentialTypeCategory ( Type at ) {
80
- result = EssentiallyBooleanType ( ) and at instanceof MisraBoolType
81
- or
82
- result = EssentiallyCharacterType ( ) and at instanceof PlainCharType
83
- or
84
- result = EssentiallySignedType ( ) and
85
- at .( IntegralType ) .isSigned ( ) and
86
- not at instanceof PlainCharType
87
- or
88
- result = EssentiallyUnsignedType ( ) and
89
- at .( IntegralType ) .isUnsigned ( ) and
90
- not at instanceof PlainCharType
91
- or
92
- result = EssentiallyEnumType ( ) and at instanceof Enum and not at instanceof MisraBoolType
93
- or
94
- result = EssentiallyFloatingType ( ) and
95
- at instanceof FloatingPointType
79
+ EssentialTypeCategory getEssentialTypeCategory ( Type type ) {
80
+ exists ( Type essentialType |
81
+ // Resolve typedefs to ensure
82
+ essentialType = type .getUnderlyingType ( )
83
+ |
84
+ result = EssentiallyBooleanType ( ) and essentialType instanceof MisraBoolType
85
+ or
86
+ result = EssentiallyCharacterType ( ) and essentialType instanceof PlainCharType
87
+ or
88
+ result = EssentiallySignedType ( ) and
89
+ essentialType .( IntegralType ) .isSigned ( ) and
90
+ not essentialType instanceof PlainCharType
91
+ or
92
+ result = EssentiallyUnsignedType ( ) and
93
+ essentialType .( IntegralType ) .isUnsigned ( ) and
94
+ not essentialType instanceof PlainCharType
95
+ or
96
+ result = EssentiallyEnumType ( ) and
97
+ essentialType instanceof Enum and
98
+ not essentialType instanceof MisraBoolType
99
+ or
100
+ result = EssentiallyFloatingType ( ) and
101
+ essentialType instanceof FloatingPointType
102
+ )
96
103
}
97
104
98
105
/**
0 commit comments