qt5base-lts/tests/auto/corelib
Marc Mutz eb9c8042cf Short live QT_ENABLE_P0846_SEMANTICS_FOR!
In C++17, unqualified lookup doesn't find function templates that
require ADL from a call with explicit template arguments, unless
another function template of that name is in scope (otherwise, the <
is parsed as operator less-than instead).

P0846, merged for C++20, fixes this to repeat the name lookup, parsing
the < as indicating a template.

We have API in Qt (Tuple Protocol for some types, e.g. QPoint) that
work for the purpose of Structured Bindings, but don't work for manual
unqualified calls when P0846 semantics are missing, and we're adding
more, to QVariant, so add a macro to handle the issue.

The macro simply declares a function template overload of the given
name for a throw-away struct, thereby bringing, for that one name,
P0846 semantics into C++17.

When we require C++20, we can drop this again.

Amends:
- fb6b7869e8 for QPoint(F)
- 8ae9431c79 for QMargins(F)
- 0e22001a3b for the rest

[ChangeLog][QtCore][QSize/F, QMargins/F, QPoint/F] Fixed manual
get<I>() calls (Tuple Protocol) in C++17 mode.

Task-number: QTBUG-111598
Change-Id: I2ffaef12c5bb6d82f75ce78a7c03c6789dfa0691
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2023-03-22 15:59:10 +00:00
..
animation tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
global tst_qmessagehandler: fix QtTest warnings about duplicate row names 2023-02-23 10:33:39 -08:00
io Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definition 2023-03-20 19:18:52 +01:00
ipc tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
itemmodels QAbstractItemModel: fix match() with Qt::MatchWildcard 2023-03-09 18:26:59 +01:00
kernel QThread: add sleep(std::chrono::nanoseconds) overload 2023-03-13 23:26:28 +02:00
mimetypes QMimeDatabase: cleanup unittest 2023-03-11 12:39:56 +02:00
platform tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
plugin Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definition 2023-03-20 19:18:52 +01:00
serialization tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
text Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definition 2023-03-20 19:18:52 +01:00
thread Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definition 2023-03-20 19:18:52 +01:00
time Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definition 2023-03-20 19:18:52 +01:00
tools Short live QT_ENABLE_P0846_SEMANTICS_FOR! 2023-03-22 15:59:10 +00:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00