File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 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 {
306306
307307 TEST_CASE(knownConditionFloating);
308308 TEST_CASE(knownConditionPrefixed);
309+
310+ TEST_CASE(ternarySameValuePlatformDependent); // #13773
309311 }
310312
311313#define check(...) check_(__FILE__, __LINE__, __VA_ARGS__)
@@ -13093,6 +13095,19 @@ class TestOther : public TestFixture {
1309313095 "[test.cpp:2:13] -> [test.cpp:3:11]: (style) The comparison 'i > +1' is always false. [knownConditionTrueFalse]\n",
1309413096 errout_str());
1309513097 }
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+ }
1309613111};
1309713112
1309813113REGISTER_TEST(TestOther)
You can’t perform that action at this time.
0 commit comments