File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,8 @@ class TestOther : public TestFixture {
306
306
307
307
TEST_CASE(knownConditionFloating);
308
308
TEST_CASE(knownConditionPrefixed);
309
+
310
+ TEST_CASE(ternarySameValuePlatformDependent); // #13773
309
311
}
310
312
311
313
#define check(...) check_(__FILE__, __LINE__, __VA_ARGS__)
@@ -13093,6 +13095,19 @@ class TestOther : public TestFixture {
13093
13095
"[test.cpp:2:13] -> [test.cpp:3:11]: (style) The comparison 'i > +1' is always false. [knownConditionTrueFalse]\n",
13094
13096
errout_str());
13095
13097
}
13098
+
13099
+ void ternarySameValuePlatformDependent() // #13773
13100
+ {
13101
+ check("typedef float _Complex complex_f32;\n"
13102
+ "typedef struct {\n"
13103
+ " uint16_t real;\n"
13104
+ " uint16_t imag;\n"
13105
+ "} packed_complex;\n"
13106
+ "void foo(void) {\n"
13107
+ " b = a ? sizeof(packed_complex) : sizeof(complex_f32);\n"
13108
+ "}\n");
13109
+ ASSERT_EQUALS("", errout_str());
13110
+ }
13096
13111
};
13097
13112
13098
13113
REGISTER_TEST(TestOther)
You can’t perform that action at this time.
0 commit comments