Qt 6.8.3 with BlackBerry 10 (QNX 8 / ARMv7) patches
 
 
 
 
 
 
Go to file
Marc Mutz e11edced7e QStringView: fix construction from arrays of unknown size
The original idea (8b5aa7b6c4) of the
separation of array and pointer ctors was to determine string literal
sizes at compile-time in C++11's limited constexpr semantics.

But when the scanning for NUL characters was added to the array ctor
in 107ff4c1d6, the distinction between
the two ctors became meaningless, because we were able to assume
post-C++11 constexpr to make the Char(0) scan a compile-time action.

Finally, 9e1dc1e8a9 removed the array
ctor in favor of the generic Container ctor. I didn't check whether
the old code handled arrays of unknown size, as in

    extern const char16_t str[];
    QStringView sv = str;
    ~~~
    const char16_t str[] = "str";

but std::size() (and therefore if_compatible_container) surely bails
on such arrays, and if_compatible_pointer also SFINAEs out. As a
consequence, such arrays cannot be used to construct QStringViews atm.

Fix by adding a new constructor for arrays of unknown size, delegating
to the existing pointer overload.

The GHS compiler doesn't like the CanConvert static_asserts, so
comment them out for it. The functionality itself is tested by
the from*ArrayWithUnknownSize tests.

[ChangeLog][QtCore][QStringView] Made construction from arrays of
unknown size compile. Such arrays will use the const Char*
constructor, determining the size of the array at runtime.

Pick-to: 6.5
Task-number: QTBUG-112746
Change-Id: Ifdb217350d93d38f081c99f14661975491d32076
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 56faffd92bf0ac459a921ec043a6f3b3dba51acc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2dfc0cb6f6f1e29a0a1318793b29b89390543be6)
2024-12-13 08:00:15 +00:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
LICENSES Add REUSE.toml files 2024-11-07 08:38:49 +01:00
bin CMake: Don't hard-code "libexec" in qt-configure-module 2024-08-20 13:50:32 +02:00
cmake CMake: Support manual multiple projects within-a-repo SBOM generation 2024-12-05 16:44:33 +00:00
coin coin: Build qdoc as part of repo instructions for CI doc building 2024-11-02 14:49:15 +01:00
config.tests QThread/Unix: refactor to split QThreadPrivate::finish() in two phases 2024-11-07 15:00:11 -07:00
dist Add REUSE.toml files 2024-11-07 08:38:49 +01:00
doc Docs: Fix broken layout on landing page (dark offline style) 2024-12-09 11:39:32 +00:00
examples Improve drag-and-drop visual handling in DragWidget 2024-12-05 23:29:12 +00:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
libexec Android: add option to run app detached to runner script 2024-12-04 14:44:52 +00:00
mkspecs Add REUSE.toml files 2024-11-07 08:38:49 +01:00
qmake QFactoryLoader: fix the ability to load symlinks to plugins 2024-10-17 17:01:41 -07:00
src QStringView: fix construction from arrays of unknown size 2024-12-13 08:00:15 +00:00
tests QStringView: fix construction from arrays of unknown size 2024-12-13 08:00:15 +00:00
util Add type annotations to Locale 2024-12-12 20:11:12 +00:00
.cmake.conf CMake: Decouple applied cmake policies from CMake version set 2024-11-14 18:59:00 +00:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Git ignore Visual Studio CMake build directories 2023-11-24 23:42:05 +01:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag
CMakeLists.txt cmake: add _extra_files IDE target from heuristics 2024-04-12 08:36:01 +08:00
REUSE.toml Add REUSE.toml files 2024-11-07 08:38:49 +01:00
config_help.txt CMake: Change SBOM generation to be enabled by default (mostly) 2024-10-21 08:37:20 +00:00
configure Change configure license 2024-02-02 15:23:02 +00:00
configure.bat configure.bat: Fix errors on Windows 2024-03-05 11:56:24 +01:00
configure.cmake CMake: Report success for 'separate_debug_info' where applicable 2024-11-02 16:25:06 +00:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
licenseRule.json Include relevant Unicode Inc. copyright line in generated data files 2024-08-31 08:56:42 +00:00
qt_cmdline.cmake configure: accept -c++std c++17 again 2024-06-13 20:40:06 +00:00