diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2024-12-05 11:39:53 +0100 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2024-12-12 21:06:59 +0100 |
| commit | e64fd05fecae291c9d7358d2e47d7170995af256 (patch) | |
| tree | 6303015c4ea4b906c4ee46bcd02b033d81c3c24f /src/corelib/debug_script.py | |
| parent | a38cebfe23674bb459eed6bbbcac965ebf2b6075 (diff) | |
tst_QString: extend arg() tests with enums w/o explicit underlying_type
The QtDeclarative code causing QTBUG-131906 hits UB, because it tries
to store -666 in an enum {A, B}, which has a valid range of [0,1],
therefore its underlying_type is uint, yet, as per [conv.prom]/3¹,
integer-promotes to _int_ instead, so in Qt 6.8 would cause the
arg(int) overload to be called, outputting -666, while in Qt 6.9, it's
treated (correctly) as an unsigned value, outputting -666's two's
complement, a positive value.
Add a version of the scenario that does not cause UB.
¹ Thanks to Ahmad Samir for digging up the pertinent legalese.
Task-number: QTBUG-131906
Pick-to: 6.9 6.8 6.5
Change-Id: Iba1a04de523a0b4cd1c87deea40c643cf16df14f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/debug_script.py')
0 files changed, 0 insertions, 0 deletions
