Commit Graph

1394 Commits

Author SHA1 Message Date
Kari Oikarinen
89f443dfbc QScopeGuard: Fix build failures with qScopeGuard()
Partially reverts 4f077b7e5f.

Can't overload with forwarding references and lvalue references. Use a single
forwarding reference overload, but take care of not trying to create a
QScopeGuard of reference type and forward instead of moving.

Add tests to ensure calling with both lvalues and rvalues is possible.

Change-Id: Ia034afe0a8feb08246c2c7c154a85cae37421c98
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-01 11:07:08 +02:00
Kari Oikarinen
4f077b7e5f QScopeGuard: Make constructor public
With Class Template Argument Deduction users might want to use the constructor
itself instead of a separate helper function. In both cases it's possible to let
the compiler deduce the template arguments.

Try to make the usefulness of the helper function in the absence of CTAD still
clear in the documentation.

Change-Id: I9b07983c1fb276a6dd9e7ed4c3e606764e9b68ca
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-01-30 07:30:17 +02:00
Qt Forward Merge Bot
082faeff9c Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/gui/image/qpnghandler.cpp

Change-Id: I8630f363457bb613d8fb88470a71d95d97cdb301
2020-01-28 08:09:51 +01:00
Tor Arne Vestbø
92918e567a Flatten version-specific blacklisting on macOS to all macOS versions
We don't know which versions these blacklistings actually apply on
unless we actually get macOS 10.14 and 10.15 into the CI and running
tests, so let's start with that, and then granularize the blacklists
after that.

Task-number: QTBUG-75786
Change-Id: Id79642afa50cb20efa2cd209286b6933918d3a4a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-22 17:58:31 +01:00
Mårten Nordheim
d98a1ef902 Add QMap::insert(const QMap &map)
As opposed to unite(), this inserts one map into the other
without duplicating elements.

Task-number: QTBUG-35544
Change-Id: Ie8ab350b29148851a3176cef1007e8a4ca82c273
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-12 15:25:30 +01:00
Liang Qi
90210d5d9c Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	tests/auto/network/kernel/qnetworkinterface/BLACKLIST

Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
2019-12-10 13:51:40 +02:00
Tor Arne Vestbø
c3bd5ffdc8 Don't wrap feature detection macros with QT_HAS_FOO() variants
Using wrappers for these macros is problematic when for example passing the
-frewrite-includes flag to preprocess sources before shipping off to distcc
or Icecream. It will also start producing warnings when compilers implement
http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example
https://reviews.llvm.org/D49091

Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at
https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
recommend defining '__has_foo(x) 0' as a fallback for compilers without the
macros, so that's what we go for.

Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767
Reviewed-by: Alex Richardson <arichardson.kde@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-10 00:48:07 +01:00
Lars Knoll
7b34da9ef1 Add QHash::insert(const QHash &other)
As opposed to unite(), this inserts one hash into the other
without duplicating elements.

Change-Id: Ifc786c48f5dc3ab18c29782e73eac3c1a3ef8981
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-05 11:50:32 +01:00
Kari Oikarinen
315c2c468e tst_QScopeGuard: Remove unused lambda capture
qt5/qtbase/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp💯38:
      warning: lambda capture 'caught' is not used [-Wunused-lambda-capture]
        auto cleanup = qScopeGuard([&caught] { s_globalState++; });
                                    ~^~~~~~

Change-Id: I0d9b85896594f3ea35c8003846d4ac7ab5e33d16
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-19 18:33:43 +02:00
Qt Forward Merge Bot
b327807c5e Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/io/qstandardpaths_unix.cpp
	src/corelib/tools/qsharedpointer_impl.h
	tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
2019-10-24 10:23:44 +02:00
Milian Wolff
014d7ac654 Q{Shared,Weak}Pointer: Reduce overload sets in implicit conversions
Only allow implicit conversions when the types involved are compatible.
That means, only allow construction and copy assignment when the type
X* is convertible to type T*. This is done using SFINAE and the
std::is_convertible type trait, which makes the previous
QSHAREDPOINTER_VERIFY_AUTO_CAST obsolete.

This patch fixes compilation when a function is overloaded with
Q{Shared,Weak}Pointer of different, incompatible types. Previously, this
resulted in a compilation error due to an ambiguous overload.

Change-Id: I069d22f3582e69842f14284d4f27827326597ca2
Fixes: QTBUG-75222
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-11 16:53:23 +02:00
Eirik Aavitsland
c54083ff93 Fix QEasingCurve possible imprecision at endpoints
Both the spline curves and (most of) the predefines curves are defined
as having start value 0.0 and end value 1.0. The spline and In/OutBack
functions would sometimes not produce that result precisely, so code
could not reliably depend on expressions like (easedValue < 1.0)
becoming false. Fix by explicitly handling endpoints.

Fixes: QTBUG-76781
Fixes: QTBUG-72630
Change-Id: I21be43af469a76c090154bffef8406a9baf2d0b1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-11 12:29:27 +02:00
Liang Qi
99cdd5fc67 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/global/qrandom.cpp
	src/corelib/io/qfileinfo.cpp
	src/corelib/kernel/qeventdispatcher_win.cpp
	src/corelib/kernel/qeventdispatcher_win_p.h
	src/gui/text/qfontdatabase.cpp
	src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
	src/plugins/platforms/windows/qwindowsglcontext.cpp
	src/testlib/qtestcase.cpp

Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4893212471aa24be804c989a581810e2f714545c
2019-09-30 14:43:02 +02:00
Friedemann Kleint
74179a209a Revert "BLACKLIST insert_remove_loop for msvc-2019"
The error was due to a compiler optimization bug, which is fixed
in 16.3.0.

This reverts commit 305f2c3aa6.

Fixes: QTBUG-77239
Change-Id: Idfb86ad5c3ec026518f0713c41f7ad744ab4d5db
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-24 10:26:00 +02:00
Oliver Wolff
f72dfdb9af Skip tst_QDateTime::systemTimeZoneChange for UWP configurations
Due to their sandboxed nature, UWP applications do not have access to
system settings like time zone.

Fixes: QTBUG-71185
Change-Id: I567a255f8adc18838fff79b81210faa094674722
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-24 06:18:07 +02:00
Marc Mutz
5b2dfbc649 Long live QSize(F)::grownBy/shrunkBy()
These functions tighten the integration of QMargins(F) with the rest
of the geometry classes by providing a way to apply margins to sizes
(and later, rects).

Apply them in a few obvious cases across QtWidgets.

[ChangeLog][QtCore][QSize/QSizeF] Added grownBy(QMargin(F))/shrunkBy(QMargin(F)).

Change-Id: I8a549436824cdb7fb6125a8cde89d5bf02826934
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-22 11:38:54 +02:00
Daniel Smith
662fec6f0d Update for failures only on dev branch. Use general platform names
This patch was generated with tooling from patchset 31 of
https://codereview.qt-project.org/c/qt/qtqa/+/267034 in interactive
mode. General platform names were chosen if greater than 60% of the
currently active platforms of a given type in COIN recently failed.

Change-Id: Ia4bde7f0ec422bbb727dc9d7151295159094f146
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-08-19 18:22:11 +02:00
Liang Qi
1dade1bd8a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	mkspecs/win32-clang-msvc/qmake.conf
	src/corelib/tools/qlist.h
	src/gui/painting/qcompositionfunctions.cpp
	src/gui/painting/qtriangulator_p.h
	src/gui/text/qfontengine_p.h
	src/network/kernel/qhostinfo_p.h
	src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp

Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798
2019-08-13 09:46:17 +02:00
Liang Qi
44c393f9b6 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	config.tests/arch/write_info.pri
		Repair architecture config test for the WASM_OBJECT_FILES=1 build mode
	configure.pri
	tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp

Done-With: Jörg Bornemann <joerg.bornemann@qt.io>
Change-Id: I9e12088356eb5bc65b53211cd7a8e330cccd1bb4
2019-08-12 13:23:11 +02:00
Thiago Macieira
6ce9404a6e QBitArray: fix fromBits() and actually test it
When I initially added it, it was ony for QCborValue, but I never added
the tests. Turns out there were two bugs:

[ChangeLog][QtCore][QBitArray] Fixed two bugs that caused QBitArrays
created using fromBits() not to compare equal to the equivalent
QBitArray created using other methods if the size was zero or not a
multiple of 4. If the size modulus 8 was 5, 6, or 7, the data was
actually incorrect.

Fixes: QTBUG-77285
Change-Id: Ife213d861bb14c1787e1fffd15b70573d162042c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-08-08 20:27:04 -07:00
Marc Mutz
1563c38a4b QPoint/F: add transposed()
For symmetry with QSize and QRect and because there were some users in Qt.

Port those users.

[ChangeLog][QtCore][QPoint/QPointF] Added transposed().

Change-Id: If4f23dbcf7d67983a6b1885e0d1d538115b49e2b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-08-07 23:09:06 +03:00
Marc Mutz
247ab241c7 QVector/QList/QLinkedList/QVarLengthArray/QSet: add missing deduction guides
Amends 2e1763d83a.

The new range ctors need deduction guides, since the compiler can't
deduce the value_type from a pair of iterators.

Change-Id: I3ec1e5f91305b317c443b6a70246be416b55bad9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-07 23:09:03 +03:00
Sona Kurazyan
d914a5ba4e Remove the remaining usages of deprecated APIs of qtbase
This change removes the leftovers form other cleanup commits.

Task-number: QTBUG-76491
Change-Id: I61440f87c5a280f9666b78e19aac4d8ac603767e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2019-08-01 06:48:27 +02:00
Qt Forward Merge Bot
5ee1c86d10 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I4505ec6fe17a1aa2c8d1e6576234d06a34eb9f99
2019-08-01 01:00:10 +02:00
Heikki Halmet
305f2c3aa6 BLACKLIST insert_remove_loop for msvc-2019
Task-number: QTBUG-77239
Change-Id: Ie1a08db0b4c4e1bbcb7981f24bcf12d5e6d33e48
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2019-07-30 14:11:02 +03:00
Qt Forward Merge Bot
8f0790dd90 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I999ba23a27cd897017d15c6ffe41ea8cd008ffb9
2019-07-19 01:00:41 +02:00
Thiago Macieira
8abbbb4c48 Fix regression causing QVector::fill w/ same size to not detach
Caused by commit 01301b0b34, which made
vector.resize(vector.size()) not to detach, which was used by fill() and
assumed that detaching happened. The test does not test the resize()
behavior, only that fill() is not broken anymore.

[ChangeLog][QtCore][QVector] Fixed a regression that caused fill() not
to detach, corrupting shared copies.

Fixes: QTBUG-77058
Change-Id: I6aed4df6a12e43c3ac8efffd15b1b527a8007bf3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-16 18:09:51 -07:00
Marc Mutz
205824103e QVarLengthArray: optimize pop_back()
Don't call realloc() with all its machinery when we know exactly what
to do: destroy the last element and decrease the size by one.

Extend the test, removing the unused Foo class for a new Tracker one.

Change-Id: I568eef4f6335669689fb16fd23af92cb4d6464bd
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-07-14 15:44:22 +00:00
Marc Mutz
0a724ac74c Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of it
QLinkedList is still used in several tests. Add exceptions for
these subdirs.

Change-Id: I50ccd2a0892129d4a47aa4e2400211690da9a82d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-12 14:26:30 +02:00
Edward Welbourne
a9aa206b7b Move text-related code out of corelib/tools/ to corelib/text/
This includes byte array, string, char, unicode, locale, collation and
regular expressions.

Change-Id: I8b125fa52c8c513eb57a0f1298b91910e5a0d786
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-10 17:05:30 +02:00
Daniel Smith
6c136973fd unblacklist passing tests
These tests have not failed on the removed platforms for at least 60 days

Task-number: QTBUG-76608
Change-Id: If7a9f4db907124e3cd54e3f4b0ad3e20717d1912
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-08 11:01:42 +00:00
Giuseppe D'Angelo
3a1f9dec7c Q_ARRAY_LITERAL: protect the check for literal types
Some compilers (hello, MSVC) do not produce literal types in Qt
because their constexpr support has been blacklisted.
Therefore, amend the check for literal types in Q_ARRAY_LITERAL:
only do the check if the compiler supports constexpr.

Change-Id: I7cffe00dde447d975aa6a7d02248df9c351508ff
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-06 19:07:04 +00:00
Sona Kurazyan
9b3e8b32f2 Remove usages of deprecated APIs of corelib
- Replaced the usages of deprecated APIs of corelib by corresponding
  alternatives in the library code and documentation.

- Modified the tests to make them build when deprecated APIs disabled:
    * Made the the parts of the tests testing the deprecated APIs to
      be compiled conditionally, only when the corresponding methods are
      enabled.
    * If the test-case tests only the deprecated API, but not the
      corresponding replacement, added tests for the replacement.

Task-number: QTBUG-76491
Task-number: QTBUG-76539
Task-number: QTBUG-76541
Change-Id: I62ed4a5b530a965ec3f6502c6480808f938921aa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-05 11:25:46 +02:00
Marc Mutz
f70905448f Add QT_NO_JAVA_STYLE_ITERATORS and mark QtBase free of it
... except for tests, which manually undefine the macro.

Like QT_NO_FOREACH, this is a technical way to keep JSI-free
modules JSI-free going forward.

Change-Id: Icf1342da00a700f42f9e32a253d1cdb94c38dd7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-03 14:48:37 +02:00
Sona Kurazyan
8c8eae279d Remove usages of deprecated APIs from QDateTime
- Replaced the usages of:
  * QDateTime::toTime_t() -> QDateTime::toSecsSinceEpoch().
  * QDateTime::fromTime_t() -> QDateTime::fromSecsSinceEpoch().
  * QDate::shortDayName() -> QLocale::system().dayName().
  * QTime by QElapsedTimer, where the deprecated methods of QTime
    were used.

- Modified the tests for the deprecated methods to be enabled only
  when the corresponding methods are enabled: when the deprecated
  APIs are disabled, the tests will be also disabled, and the
  compilation won't be broken.

Task-number: QTBUG-76491
Change-Id: I4d565db2329e580c567aae511696eb1efe120843
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-02 09:49:36 +02:00
Ulf Hermann
c34242c679 Make the default ctor of QVarLengthArray implicit
Otherwise "QVarLengthArray<Foo> x = {};" gives a warning. Also, some
compilers get confused about "QVarLengthArray()" this way.

Task-number: QTBUG-76199
Change-Id: I4296586c0181d3e6e82ca8b7b79aeb9a21645d1f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-02 09:39:33 +02:00
Mat Sutcliffe
2a99f60cfb QStringList: add QStringView overloads of join, filter, replaceInStrings
[ChangeLog][QtCore][QStringList] Added QStringView overloads of join(),
filter(), and replaceInStrings().

Change-Id: I9636e21e2e43ed46cce0aa7fa23ab0710aa641ba
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-30 23:16:11 +00:00
Sona Kurazyan
ff2b2032a0 Remove usages of deprecated APIs from QtAlgorithms
Task-number: QTBUG-76491
Change-Id: I9dab736a0cbd2e86588919640c26e8ce6b3674d0
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-06-29 21:58:36 +02:00
Friedemann Kleint
8f0e3ad518 Corelib tests: Fix out of bounds string access
Fix warnings:
Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt.

introduced by qtbase/c2d2757bccc68e1b981df059786c2e76f2969530 (5.14).

Change-Id: Ie6f0e2e3bb198a95dd40e7416adc8ffb29f3b2ba
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
 
 
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-28 00:24:54 +02:00
Liang Qi
25eb97d2d4 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf
	src/network/ssl/qsslsocket_openssl.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
2019-06-27 14:38:03 +02:00
Giuseppe D'Angelo
5e86aa93fc QByteArray autotest: code tidies
Suppress a few warnings raised by GCC 9.

Change-Id: Ic52dc9c85e447ee0f54ef8310a7fcd41d6e09304
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-23 15:52:41 +02:00
Marc Mutz
35431062bd QString: towards QStringView::arg() pt.3: Long live QStringView/QLatin1String::arg()
This version of arg(), unlike its QString counterpart, transparently accepts
views without conversion to QString, and is also extensible to further argument
types, say a future QFormattedNumber.

[ChangeLog][QtCore][QStringView/QLatin1String] Added arg(), taking arbitrarily
many strings.

Change-Id: If40ef3c445f63383e32573f3f515fdda84c7fe3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-20 19:36:37 +02:00
Giuseppe D'Angelo
34fe9232db Port from QAtomic::load() to loadRelaxed()
Semi-automated, just needed ~20 manual fixes:

$ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} +
$ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} +

It can be easily improved (e.g. for store check that there are no commas
after the opening parens). The most common offender is QLibrary::load,
and some code using std::atomic directly.

Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-20 20:48:59 +02:00
Samuel Gaist
94495c814f test: migrate collections test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: Iff9d4be685bf360ad921e29a82cb878ae5c46180
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 19:24:05 +00:00
Volker Hilsheimer
5aaade8c93 Fix editing of QDateTimeEdit in 12-hour locales that don't use AM/PM
The code made two incorrect assumptions: that the strings used are "AM"
or "PM", or would be translated. Instead, the locale provides the
correct strings, and there is no need to translate. However, in order
not to break existing translations, we give those preference.

And that the AM/PM string is not longer than 4 characters, while in
e.g Spanish/Columbia locale the strings are "A. M." and "P. M.", ie 5
characters long. Also, the use of qMin in a function that is asked to
provide the maximum section length is wrong.

[ChangeLog][QWidgets][QDateTimeEdit] Use the information provided by
the locale to determine the AM/PM strings, unless they are already
translated.

Change-Id: I6d1b05376e5ac62fc58da2cdea2e6cb732ec6747
Fixes: QTBUG-72833
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-05-28 06:14:32 +00:00
wangChuan
b0493998c3 QTextBoundaryFinder: don't break after uppercase followed by comma
[ChangeLog][QtCore][QTextBoundaryFinder] Sentence breaking now
no longer breaks between uppercase letters and comma.
This is a deviation from the Unicode specification,
but produces less surprising behavior.

Fixes: QTBUG-75857
Change-Id: If1e78b3be3f20250d01100353ea7da6110985f82
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-05-23 01:24:18 +00:00
Liang Qi
da23302e4d Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-06-07 13:19:27 +02:00
Liang Qi
9967a011ea Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	qmake/generators/makefile.cpp
	src/plugins/platforms/cocoa/qcocoaintegration.h
	src/plugins/platforms/cocoa/qcocoaintegration.mm

Done-With: Jörg Bornemann <joerg.bornemann@qt.io>
Change-Id: I5a61e161784cc6f947abe370aab8f2971a9cbe78
2019-06-07 13:19:27 +02:00
Allan Sandfeld Jensen
cf7d990a48 Fix reference to a dead temporary
NoDefaultConstructorRef1 was taking a reference of the input, which
meant in the first test it would get a reference to the temporary
created by the 1 literal. A temporary that would be out of scope by
the time we check its value.

Instead add a test with unique_ptr to test we can pass movable
temporaries.

Change-Id: I6b02377dfe30c82b6e71bfb3353a81ad81558ed3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-22 11:22:40 +02:00
Giuseppe D'Angelo
b9f96cacc9 QRegExp: remove an out of bounds access into QString
... spotted with the brand-new checks for that in QCharRef.

The rx[i] == ~~~ check is clearly wrong, as rx is the regexp
we're building and `i` was not supposed to index into it.

The intended meaning was wc[i] == ~~~, testing if we were seeing
the closing bracket of a character set. We need to check for
that immediately for dealing with the special syntax of []...] where
the ] belongs to the character set (it can't be the closing one
as character sets cannot be empty).

Fix and add a regression test. Bonus: this code was almost
unchanged since 2009.

Change-Id: I958cd87fc25558e9d202d18b3dd4a35d0db16d8d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 17:33:30 +00:00