From 8edbcdbeb49630c207f3111d24b9c9e07029e333 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 6 Aug 2023 17:03:37 +0200 Subject: Mark the module as free of Q_FOREACH, except where it isn't The density of Q_FOREACH uses is high here, too high for this author, unfamiliar with this code, to tackle in a short amount of time. But they're concentrated in just a few TUs, so pick a different strategy: Mark the whole module with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). Created QTBUG-115808 to keep track of this. Task-number: QTBUG-115808 Change-Id: I29c377f939e3d747e3ce72c224c4ee722df7a95d Reviewed-by: Joerg Bornemann Reviewed-by: Fabian Kosmale --- tests/auto/qml/qqmlqt/tst_qqmlqt.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto/qml/qqmlqt') diff --git a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp index a4692de826..a36a4fa744 100644 --- a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp +++ b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp @@ -1,6 +1,8 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses + #include #include -- cgit v1.2.3