diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-12-15 16:52:48 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-12-16 09:43:58 +0100 |
commit | 4271114dc6b6c699efe11dc1a2b8946d2bbbb241 (patch) | |
tree | ef0e1949cc89f9a398d29c5d89d8b0b6cba00593 /tests/auto/corelib/global/qxp | |
parent | 41c41b4ba58ee4a7d5f66d8f03d40b8631ba7547 (diff) |
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.7 6.6 6.5
Change-Id: Ief9c5ff30895f8bfccec1c24d1777d3dab76c95a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/corelib/global/qxp')
-rw-r--r-- | tests/auto/corelib/global/qxp/function_ref/tst_qxp_function_ref.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/corelib/global/qxp/function_ref/tst_qxp_function_ref.cpp b/tests/auto/corelib/global/qxp/function_ref/tst_qxp_function_ref.cpp index 6264e6a5ae..702e8ebcd1 100644 --- a/tests/auto/corelib/global/qxp/function_ref/tst_qxp_function_ref.cpp +++ b/tests/auto/corelib/global/qxp/function_ref/tst_qxp_function_ref.cpp @@ -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); |