diff --git a/src/gui/math3d/qvectornd.h b/src/gui/math3d/qvectornd.h index 639b8f0e5a..a8adf12801 100644 --- a/src/gui/math3d/qvectornd.h +++ b/src/gui/math3d/qvectornd.h @@ -15,6 +15,8 @@ QT_BEGIN_NAMESPACE +// QT_ENABLE_P0846_SEMANTICS_FOR(get) // from qpoint.h + class QVector2D; class QVector3D; class QVector4D; diff --git a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp index ade6eba796..beba252293 100644 --- a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp +++ b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp @@ -1,6 +1,39 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#include +#include +#include +#ifdef QVARIANT_H +# error "This test requires qvector{2,3,4}d.h to not include qvariant.h" +#endif + +// don't assume +template +constexpr inline bool my_is_same_v = false; +template +constexpr inline bool my_is_same_v = true; + +#define CHECK(cvref) \ + static_assert(my_is_same_v(std::declval())), float cvref >); \ + static_assert(my_is_same_v(std::declval())), float cvref >); \ + \ + static_assert(my_is_same_v(std::declval())), float cvref >); \ + static_assert(my_is_same_v(std::declval())), float cvref >); \ + static_assert(my_is_same_v(std::declval())), float cvref >); \ + \ + static_assert(my_is_same_v(std::declval())), float cvref >); \ + static_assert(my_is_same_v(std::declval())), float cvref >); \ + static_assert(my_is_same_v(std::declval())), float cvref >); \ + static_assert(my_is_same_v(std::declval())), float cvref >) + +CHECK(&); +CHECK(const &); +CHECK(&&); +CHECK(const &&); + +#undef CHECK + #include #include #include