diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2024-12-11 10:59:59 +0100 |
|---|---|---|
| committer | Ahmad Samir <a.samirh78@gmail.com> | 2024-12-16 09:19:16 +0000 |
| commit | a0e65398483729259cf58781949133c6055fdc7c (patch) | |
| tree | 243a565448559bd2c893708064cee013da8b06c7 /cmake/QtModuleConfig.cmake.in | |
| parent | 1299aaa231b1ce989c8aedcfed372bde0e1e3a0e (diff) | |
QStringView: refuse construction from QStringRef
When QStringRef was moved out of QtCore, it was also incorrectly
removed from the if_compatible_container constraint, causing
QStringView{sr} to still match the general container QStringView ctor
overload, which doesn't preserve null'ness if data() doesn't return
null. By refusing to provide a constructor from QStringRef, we force
the compiler to use QStringRef's implicit conversion operators
instead.
This transitively affects QAnyStringView in the same way.
The tests can, naturally, only be in qt5compat, so define a macro to
communicate to tst_QStringRef whether it compiles against a fixed
QtCore or not.
Fixes: QTBUG-122797
Fixes: QTBUG-122798
Pick-to: 6.9 6.8 6.5
Change-Id: I64b75a8e421d2b6185615e3288ce3ad7fd8f15f9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Diffstat (limited to 'cmake/QtModuleConfig.cmake.in')
0 files changed, 0 insertions, 0 deletions
