qt6-bb10/src/corelib/tools
Marc Mutz bf2160e72c Clean up QStringLiteral definition
We require lambda support in the compiler since Qt 5.7, so drop
the guard macro.

Apart from MSVC 2013, all our supported compiler also support
char16_t:

- VxWorks uses GCC 4.8, which supports char16_t since 4.5.
- ICC supports char16_t since v12.1; we require v14+.
- ONX uses a GCC which supports char16_t in the compiler,
  but is equipped with a stdlib that does not sport char16_t
  support, which is why we revoke its Q_C_UNICODE_STRINGS in
  qcompilerdetection.h. But we don't need stdlib support, we
  only need the core language feature.
  This is the only platform where this patch actually changes
  something. It removes the, rather unfair, pessimization of
  the platform which could have supported the static-storage-
  duration implementation of QStringLiteral instead of the
  fallback, which uses dynamic memory (QString::fromUtf8()).
- GCC and Clang support char16_t since 4.5 and 3.0, resp.,
  which is far below our minimum compiler requirements in
  effect since Qt 5.7.
- On Windows, MSVC supports char16_t since 2015 only, and we
  still support 2013, but on Windows, wchar_t is the same size
  as char16_t, so instead of u"str" we can fall back to L"str".

So simplify the implementation of QStringLiteral by assuming
that all these feature are present, adding noexcept to the
lambda to make noexcept() queries return true.

This allows us to guarantee:

[ChangeLog][QtCore] QStringLiteral is now guaranteed to be
evaluated at compile-time. The last platform (QNX) to use the
QString::fromUtf8() fallback has been ported to allocate the
string data statically, too.

Change-Id: I7920d7a77001e5c5550e7c7d57ceb7c51c9eb443
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-15 20:14:56 +00:00
..
CLDR_LICENSE.txt Document license for CLDR data in Qt Core 2016-10-28 12:46:46 +00:00
qalgorithms.h MSVC: Fix use of POPCNT instruction without CPU check 2017-01-27 23:04:52 +00:00
qalgorithms.qdoc Unify license header usage. 2016-03-29 10:20:03 +00:00
qarraydata.cpp Add QArrayData::reallocateUnaligned for QString and QByteArray 2016-09-07 14:35:51 +00:00
qarraydata.h Add QArrayData::reallocateUnaligned for QString and QByteArray 2016-09-07 14:35:51 +00:00
qarraydataops.h Use std::enable_if instead of QEnableIf 2017-01-27 10:30:31 +00:00
qarraydatapointer.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qbitarray.cpp Merge remote-tracking branch 'origin/5.6' into 5.7 2016-06-06 09:04:55 +02:00
qbitarray.h Updated license headers 2016-01-15 12:25:24 +00:00
qbytearray.cpp Extend qChecksum calculation 2016-12-25 08:24:18 +00:00
qbytearray.h Extend qChecksum calculation 2016-12-25 08:24:18 +00:00
qbytearray_p.h Replace custom type traits with std one's 2016-11-08 15:31:17 +00:00
qbytearraylist.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qbytearraylist.h Fix parsing of documentation for QByteArrayList and QStringList 2016-03-23 08:44:11 +00:00
qbytearraymatcher.cpp Fix some qdoc warnings for 5.9 2017-02-06 16:58:04 +00:00
qbytearraymatcher.h Long live QStaticByteArrayMatcher! 2017-01-19 21:37:46 +00:00
qbytedata_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qcache.h Updated license headers 2016-01-15 12:25:24 +00:00
qcache.qdoc Unify license header usage. 2016-03-29 10:20:03 +00:00
qchar.cpp Fix minor typos in apidoc 2017-02-15 15:01:45 +00:00
qchar.h QChar: optimize comparison with QString{,Ref} 2016-04-05 19:47:37 +00:00
qcollator.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qcollator.h QCollatorSortKey: use QExplicitlySharedDataPointer as pImpl 2017-02-07 09:50:16 +00:00
qcollator_icu.cpp QCollatorSortKey: add some std::move 2017-02-13 08:42:46 +00:00
qcollator_macx.cpp QCollatorSortKey: add some std::move 2017-02-13 08:42:46 +00:00
qcollator_p.h QCollatorSortKey: add some std::move 2017-02-13 08:42:46 +00:00
qcollator_posix.cpp QCollatorSortKey: add some std::move 2017-02-13 08:42:46 +00:00
qcollator_win.cpp QCollatorSortKey: add some std::move 2017-02-13 08:42:46 +00:00
qcommandlineoption.cpp Merge remote-tracking branch 'origin/5.7' into dev 2016-08-09 17:59:51 +02:00
qcommandlineoption.h QCommandLineOption: Remove excess close parenthesis from a warning 2016-11-30 08:50:17 +00:00
qcommandlineparser.cpp Merge remote-tracking branch 'origin/5.7' into dev 2016-08-16 07:58:32 +02:00
qcommandlineparser.h Add configure feature for QCommandLineParser 2016-10-11 14:20:24 +00:00
qcontainerfwd.h Updated license headers 2016-01-15 12:25:24 +00:00
qcontiguouscache.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qcontiguouscache.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qcryptographichash.cpp Merge remote-tracking branch 'origin/5.6' into 5.7 2016-06-06 09:04:55 +02:00
qcryptographichash.h Make QCryptographicHash a Q_GADGET. 2016-06-07 19:01:02 +00:00
qdatetime.cpp Simplify QDateTime::toString(Qt::TextDate)'s text construction 2016-12-14 16:41:06 +00:00
qdatetime.h Add configure feature for time zone support 2016-10-11 14:20:19 +00:00
qdatetime_p.h Remove two unused static methods of QDateTimePrivate 2017-01-12 16:42:21 +00:00
qdatetimeparser.cpp QDateTimeParser: de-duplicate vtable 2017-02-05 18:29:47 +00:00
qdatetimeparser_p.h QDateTimeParser: de-duplicate vtable 2017-02-05 18:29:47 +00:00
qdoublescanprint_p.h Updated license headers 2016-01-15 12:25:24 +00:00
qeasingcurve.cpp CoreLib: use const (and const APIs) more 2016-04-18 04:49:19 +00:00
qeasingcurve.h Updated license headers 2016-01-15 12:25:24 +00:00
qfreelist.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qfreelist_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qharfbuzz.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qharfbuzz_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qhash.cpp Don't narrow lengths in qHash() implementations 2017-01-31 00:38:37 +00:00
qhash.h Remove a few unnecessary recalculations of hash 2016-11-09 14:42:43 +00:00
qhashfunctions.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qiterator.h Updated license headers 2016-01-15 12:25:24 +00:00
qiterator.qdoc Unify license header usage. 2016-03-29 10:20:03 +00:00
qline.cpp Add QLineF::center() returning the point in the center of the line 2016-05-27 08:49:44 +00:00
qline.h Add QLineF::center() returning the point in the center of the line 2016-05-27 08:49:44 +00:00
qlinkedlist.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qlinkedlist.h Merge remote-tracking branch 'origin/5.7' into 5.8 2016-08-29 15:30:17 +02:00
qlist.cpp Merge remote-tracking branch 'origin/5.6' into 5.7 2016-10-05 19:33:26 +02:00
qlist.h Replace custom type traits with std one's 2016-11-08 15:31:17 +00:00
qlocale.cpp Merge remote-tracking branch 'origin/5.8' into dev 2017-01-25 20:06:06 +01:00
qlocale.h QLocale: Add option to pad numbers with trailing zeroes 2016-09-15 16:01:02 +00:00
qlocale.qdoc Merge remote-tracking branch 'origin/5.8' into dev 2016-11-02 09:24:11 +01:00
qlocale_data_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qlocale_icu.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qlocale_mac.mm Apple: always use the system time zone instead of the default time zone 2017-01-24 19:40:45 +00:00
qlocale_p.h QCollator: don't pipe bcp47Name() through QString 2017-02-07 19:40:10 +00:00
qlocale_tools.cpp QLocale: Fix wrong assert 2016-08-25 12:45:50 +00:00
qlocale_tools_p.h Add qstrntod as qstrtod overload, which takes a len parameter 2016-02-03 22:19:06 +00:00
qlocale_unix.cpp CoreLib: use const (and const APIs) more 2016-04-18 04:49:19 +00:00
qlocale_win.cpp QLocale(Win): fix pessimizing use of QStringBuilder 2017-01-31 08:06:37 +00:00
qmap.cpp QMap: use std::less for defining an order between pointers 2016-12-12 11:15:22 +00:00
qmap.h Use std::enable_if instead of QEnableIf 2017-01-27 10:30:31 +00:00
qmargins.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qmargins.h Updated license headers 2016-01-15 12:25:24 +00:00
qmessageauthenticationcode.cpp Merge remote-tracking branch 'origin/5.6' into 5.7 2016-06-06 09:04:55 +02:00
qmessageauthenticationcode.h Updated license headers 2016-01-15 12:25:24 +00:00
qpair.h Updated license headers 2016-01-15 12:25:24 +00:00
qpair.qdoc Unify license header usage. 2016-03-29 10:20:03 +00:00
qpodlist_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qpoint.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qpoint.h Forward declarations for platform specific types should also be done with Q_QDOC 2016-06-17 14:58:30 +00:00
qqueue.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qqueue.h Updated license headers 2016-01-15 12:25:24 +00:00
qrect.cpp QRect(F): add transposed() 2016-02-13 18:18:48 +00:00
qrect.h Forward declarations for platform specific types should also be done with Q_QDOC 2016-06-17 14:58:30 +00:00
qrefcount.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qrefcount.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qregexp.cpp Support C++17 fallthrough attribute 2016-08-19 18:38:53 +00:00
qregexp.h Updated license headers 2016-01-15 12:25:24 +00:00
qregularexpression.cpp PCRE2: port QRegularExpression to PCRE2 2016-12-12 15:22:01 +00:00
qregularexpression.h Updated license headers 2016-01-15 12:25:24 +00:00
qringbuffer.cpp QRingBuffer::reserve(): remove superfluous assert 2016-10-22 08:06:28 +00:00
qringbuffer_p.h QRingBuffer: allow to change the chunk size of the buffer dynamically 2016-07-23 09:05:04 +00:00
qscopedpointer.cpp QSharedPointer/QWeakPointer/QScopedPointer: add comparison against nullptr 2016-06-08 09:09:47 +00:00
qscopedpointer.h QSharedPointer/QWeakPointer/QScopedPointer: add comparison against nullptr 2016-06-08 09:09:47 +00:00
qscopedpointer_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qscopedvaluerollback.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qscopedvaluerollback.h Updated license headers 2016-01-15 12:25:24 +00:00
qset.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
qset.qdoc Unify license header usage. 2016-03-29 10:20:03 +00:00
qshareddata.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qshareddata.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-02-18 20:50:35 +01:00
qsharedpointer.cpp QSharedPointer/QWeakPointer/QScopedPointer: add comparison against nullptr 2016-06-08 09:09:47 +00:00
qsharedpointer.h QSharedPointer/QWeakPointer/QScopedPointer: add comparison against nullptr 2016-06-08 09:09:47 +00:00
qsharedpointer_impl.h Use std::enable_if instead of QEnableIf 2017-01-27 10:30:31 +00:00
qsimd.cpp Merge remote-tracking branch 'origin/5.7' into dev 2016-06-13 12:46:46 +02:00
qsimd_p.h Update the __xxx__ macros due to MSVC and ICC not defining them all 2017-02-12 08:16:05 +00:00
qsize.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qsize.h Forward declarations for platform specific types should also be done with Q_QDOC 2016-06-17 14:58:30 +00:00
qstack.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qstack.h Updated license headers 2016-01-15 12:25:24 +00:00
qstring.cpp QString(Ref): make toLatin1()/toLocal8Bit() null handling consistent 2017-02-15 20:12:36 +00:00
qstring.h Clean up QStringLiteral definition 2017-02-15 20:14:56 +00:00
qstring_compat.cpp QString(Ref): make toLatin1()/toLocal8Bit() null handling consistent 2017-02-15 20:12:36 +00:00
qstring_mips_dsp_asm.S Updated license headers 2016-01-15 12:25:24 +00:00
qstringalgorithms_p.h Replace custom type traits with std one's 2016-11-08 15:31:17 +00:00
qstringbuilder.cpp Drop hand-rolled ASCII conversion from QAbstractConcatenable::convertFromAscii() 2016-03-04 13:56:41 +00:00
qstringbuilder.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-07-15 20:47:57 +02:00
qstringiterator.qdoc Updated license headers 2016-01-15 12:25:24 +00:00
qstringiterator_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qstringlist.cpp Doc: Normalize \since usage 2017-01-31 08:59:50 +00:00
qstringlist.h Add QStringList::join(QLatin1String) overload 2016-09-18 07:28:56 +00:00
qstringmatcher.cpp QStringMatcher: fix setCaseSensitivity() on a non-QString-backed matcher 2017-02-07 16:31:00 +00:00
qstringmatcher.h Updated license headers 2016-01-15 12:25:24 +00:00
qt_attribution.json Document license for CLDR data in Qt Core 2016-10-28 12:46:46 +00:00
qtextboundaryfinder.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qtextboundaryfinder.h Updated license headers 2016-01-15 12:25:24 +00:00
qtimeline.cpp QtCore: use printf-style qWarning/qDebug where possible (I) 2016-03-11 10:56:15 +00:00
qtimeline.h Updated license headers 2016-01-15 12:25:24 +00:00
qtimezone.cpp Properly use QT_CONFIG macro to check for ICU 2016-11-29 19:04:37 +00:00
qtimezone.h Add conversion functions for QTimeZone and CFTimeZone/NSTimeZone 2017-01-23 21:55:22 +00:00
qtimezoneprivate.cpp Merge remote-tracking branch 'origin/5.8' into dev 2016-12-13 09:39:20 +01:00
qtimezoneprivate_android.cpp QDateTime, QTimeZone: fix mappings from zone time to UTC 2016-12-12 13:58:26 +00:00
qtimezoneprivate_data_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qtimezoneprivate_icu.cpp QDateTime: use the more efficient currentMSecsSinceEpoch() 2016-07-02 07:51:11 +00:00
qtimezoneprivate_mac.mm Add conversion functions for QTimeZone and CFTimeZone/NSTimeZone 2017-01-23 21:55:22 +00:00
qtimezoneprivate_p.h Add conversion functions for QTimeZone and CFTimeZone/NSTimeZone 2017-01-23 21:55:22 +00:00
qtimezoneprivate_tz.cpp Merge remote-tracking branch 'origin/5.8' into dev 2016-12-13 09:39:20 +01:00
qtimezoneprivate_win.cpp Merge remote-tracking branch 'origin/5.7' into dev 2016-04-05 14:22:45 +02:00
qtools_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qunicodetables.cpp Updated license headers 2016-01-15 12:25:24 +00:00
qunicodetables_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qunicodetools.cpp Fix libs build with msvc on Chinese locale on Windows 2017-02-01 08:35:42 +00:00
qunicodetools_p.h Make sure all private headers in Qt Core include qglobal_p.h 2016-06-25 08:01:04 +00:00
qvarlengtharray.h Fix possible loss of data warning 2017-01-24 15:10:21 +00:00
qvarlengtharray.qdoc Unify license header usage. 2016-03-29 10:20:03 +00:00
qvector.h Work around MSVC ABI stupidity in exporting inline members of base class 2017-01-03 15:01:32 +00:00
qvector.qdoc rename qvector.cpp => qvector.qdoc 2017-02-09 14:56:01 +00:00
qvector_msvc.cpp Update the Intel copyright year 2016-01-21 22:44:16 +00:00
qversionnumber.cpp Add Intel copyright to files that Intel has had non-trivial contribution 2016-01-21 22:44:21 +00:00
qversionnumber.h QVersionNumber: compile with -Wzero-as-null-pointer-constant 2016-03-22 09:23:48 +00:00
qvsnprintf.cpp doc: Fix all remaining "Cannot tie" errors in QtBase 2017-01-06 07:04:12 +00:00
tools.pri Merge remote-tracking branch 'origin/5.8' into 5.9 2017-02-14 11:33:02 +01:00