diff options
Diffstat (limited to 'tests/auto/corelib/tools/qpointf/tst_qpointf.cpp')
-rw-r--r-- | tests/auto/corelib/tools/qpointf/tst_qpointf.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp b/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp index a6bd0a9779..392c22c70a 100644 --- a/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp +++ b/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp @@ -1,5 +1,27 @@ // Copyright (C) 2016 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 <QPointF> +#ifdef QVARIANT_H +# error "This test requires qpoint.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<QPointF cvref >())), qreal cvref >); \ + static_assert(my_is_same_v<decltype(get<1>(std::declval<QPointF cvref >())), qreal cvref >) + +CHECK(&); +CHECK(const &); +CHECK(&&); +CHECK(const &&); + +#undef CHECK #include <QTest> #include <QBuffer> |