Skip to content

Commit 9a9138a

Browse files
committed
Extend test cases
- Add tests with different char literals - Add test case with float literal
1 parent ba39b68 commit 9a9138a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cpp/autosar/test/rules/A5-1-1/test.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,22 @@ template <typename T, int size> struct S2 {
104104
T m2[4]; // NON_COMPLIANT
105105
};
106106

107+
template <typename T, T val> struct S3 {
108+
static constexpr T value = val; // COMPLIANT;
109+
};
110+
107111
void test_fp_reported_in_371() {
108112
struct S2<int, 1> l1; // COMPLIANT
109113
struct S2<int, g1> l2; // COMPLIANT
110114
struct S2<int, f1()> l3; // COMPLIANT
115+
116+
S3<char16_t, u'\u03c0'> l4; // COMPLIANT
117+
S3<char16_t, S3<char16_t, u'\u2286'>::value> l5; // COMPLIANT
118+
S3<char32_t, U'🌌'> l6; // COMPLIANT
119+
S3<char32_t, S3<char32_t, U''>::value> l7; // COMPLIANT
120+
121+
constexpr float l8 = 3.14159f;
122+
#define delta 0.1f
123+
for (float i = 0.0f; i < l8; i += delta) { // COMPLIANT
124+
}
111125
}

0 commit comments

Comments
 (0)