tst_qxp_function_ref: check that function_ref's are trivially copyable

Mandated by P0792R9 already, but we never checked and P0792R14 has
user-defaulted assignment operators showing up in the synopsis now,
so make sure we don't accidentally break this going forward.

Amends 29b65c98e720056e87334ce88a683969e57efd3d.

Pick-to: 6.5
Change-Id: Ief9c5ff30895f8bfccec1c24d1777d3dab76c95a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4271114dc6b6c699efe11dc1a2b8946d2bbbb241)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 61566fa52d260e9246a2c487ba9048222ceed24f)
This commit is contained in:
Marc Mutz 2023-12-15 16:52:48 +01:00 committed by Qt Cherry-pick Bot
parent d2f7177d42
commit f5912990ed

View File

@ -249,6 +249,8 @@ void tst_qxp_function_ref::ctad()
qxp::function_ref f2 = &fun; \
static_assert(std::is_same_v<decltype(f2), \
qxp::function_ref<sig>>); \
static_assert(std::is_trivially_copyable_v<decltype(f)>); \
static_assert(std::is_trivially_copyable_v<decltype(f2)>); \
} while (false)
CHECK(i_f_i_nx, int (int) noexcept);