summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qsize/tst_qsize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools/qsize/tst_qsize.cpp')
-rw-r--r--tests/auto/corelib/tools/qsize/tst_qsize.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/corelib/tools/qsize/tst_qsize.cpp b/tests/auto/corelib/tools/qsize/tst_qsize.cpp
index 54ffd9fcfd..c9699c5e76 100644
--- a/tests/auto/corelib/tools/qsize/tst_qsize.cpp
+++ b/tests/auto/corelib/tools/qsize/tst_qsize.cpp
@@ -1,5 +1,27 @@
// Copyright (C) 2022 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QSize>
+#ifdef QVARIANT_H
+# error "This test requires qsize.h to not include qvariant.h"
+#endif
+
+// don't assume <type_traits>
+template <typename T, typename U>
+constexpr inline bool my_is_same_v = false;
+template <typename T>
+constexpr inline bool my_is_same_v<T, T> = true;
+
+#define CHECK(cvref) \
+ static_assert(my_is_same_v<decltype(get<0>(std::declval<QSize cvref >())), int cvref >); \
+ static_assert(my_is_same_v<decltype(get<1>(std::declval<QSize cvref >())), int cvref >)
+
+CHECK(&);
+CHECK(const &);
+CHECK(&&);
+CHECK(const &&);
+
+#undef CHECK
#include <QTest>
#include <qsize.h>