diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-06-05 14:24:31 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-06-09 14:20:31 +0200 |
commit | 4c32443bc9e738067f518fff54b1db99cde1c3fd (patch) | |
tree | cba262e4aa90db64dfa07bf67ce31c2fc2e8cfe8 /tests/auto/tools | |
parent | 910804a4202d5be645a841a1e2ec38ad63c0598d (diff) |
metatype: Do not try analyze T in Q*Pointer<T> if T is incomplete
Change-Id: I41737ce470f6d2b071ad5e85f8cad1da3869241c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/tools')
-rw-r--r-- | tests/auto/tools/moc/allmocs_baseline_in.json | 17 | ||||
-rw-r--r-- | tests/auto/tools/moc/moc.pro | 1 | ||||
-rw-r--r-- | tests/auto/tools/moc/pointery_to_incomplete.h | 48 | ||||
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 1 |
4 files changed, 67 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/allmocs_baseline_in.json b/tests/auto/tools/moc/allmocs_baseline_in.json index 94593b1ef8..f0a6aa088b 100644 --- a/tests/auto/tools/moc/allmocs_baseline_in.json +++ b/tests/auto/tools/moc/allmocs_baseline_in.json @@ -1593,6 +1593,23 @@ "outputRevision": 67 }, { + "classes": [ + { + "className": "TestPointeeCanBeIncomplete", + "object": true, + "qualifiedClassName": "TestPointeeCanBeIncomplete", + "superClasses": [ + { + "access": "public", + "name": "QObject" + } + ] + } + ], + "inputFile": "pointery_to_incomplete.h", + "outputRevision": 67 + }, + { "classes": [ { "className": "PureVirtualSignalsTest", diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro index 693a2ab2f9..5bcde6c883 100644 --- a/tests/auto/tools/moc/moc.pro +++ b/tests/auto/tools/moc/moc.pro @@ -32,6 +32,7 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n namespace.h cxx17-namespaces.h \ cxx-attributes.h \ enum_inc.h enum_with_include.h \ + pointery_to_incomplete.h \ moc_include.h # No platform specifics in the JSON files, so that we can compare them diff --git a/tests/auto/tools/moc/pointery_to_incomplete.h b/tests/auto/tools/moc/pointery_to_incomplete.h new file mode 100644 index 0000000000..1fd0d89fed --- /dev/null +++ b/tests/auto/tools/moc/pointery_to_incomplete.h @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef POINTERY_TO_INCOMPLETE_H +#define POINTERY_TO_INCOMPLETE_H + +#include <QObject> +#include <QSharedPointer> +#include <QWeakPointer> +#include <QPointer> + +class FwdClass; + +class TestPointeeCanBeIncomplete : public QObject +{ + Q_OBJECT +public: + void setProp1(QPointer<FwdClass>) {}; + void setProp2(QSharedPointer<FwdClass>) {}; + void setProp3(const QWeakPointer<FwdClass> &) {}; +}; + +#endif // POINTERY_TO_INCOMPLETE_H diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index d4e3a4e297..960164dac4 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -75,6 +75,7 @@ #include "cxx-attributes.h" #include "moc_include.h" +#include "pointery_to_incomplete.h" #include "fwdclass1.h" #include "fwdclass2.h" #include "fwdclass3.h" |