diff options
author | Pedro Alves <pedro@palves.net> | 2021-11-09 17:48:50 +0000 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2021-11-09 17:48:50 +0000 |
commit | 5da7a3deab00d81df9c5fa708520fc05d6a22ffa (patch) | |
tree | 9090b34e2064596655829d51dd469cd46ac492e6 /gdb/unittests | |
parent | f0bbba7886f5dba158a143bebbd0691591f22b9f (diff) | |
download | gdb-5da7a3deab00d81df9c5fa708520fc05d6a22ffa.zip gdb-5da7a3deab00d81df9c5fa708520fc05d6a22ffa.tar.gz gdb-5da7a3deab00d81df9c5fa708520fc05d6a22ffa.tar.bz2 |
gdb::array_view slicing/container selftest - test std::array too
Change-Id: I2141b0b8a09f6521a59908599eb5ba1a19b18dc6
Diffstat (limited to 'gdb/unittests')
-rw-r--r-- | gdb/unittests/array-view-selftests.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/unittests/array-view-selftests.c b/gdb/unittests/array-view-selftests.c index 43b7434..fe211a6 100644 --- a/gdb/unittests/array-view-selftests.c +++ b/gdb/unittests/array-view-selftests.c @@ -137,8 +137,13 @@ check_ctor_from_container () } /* namespace no_slicing */ +/* std::array with only one template argument, so we can pass it to + check_ctor_from_container. */ +template<typename T> using StdArray1 = std::array<T, 1>; + static_assert (no_slicing::check (), ""); static_assert (no_slicing::check_ctor_from_container<std::vector> (), ""); +static_assert (no_slicing::check_ctor_from_container<StdArray1> (), ""); static_assert (no_slicing::check_ctor_from_container<gdb::array_view> (), ""); /* Check that array_view implicitly converts from std::vector. */ |