gdb::array_view slicing/container selftest - test std::array too
authorPedro Alves <pedro@palves.net>
Tue, 9 Nov 2021 17:48:50 +0000 (17:48 +0000)
committerPedro Alves <pedro@palves.net>
Tue, 9 Nov 2021 17:48:50 +0000 (17:48 +0000)
Change-Id: I2141b0b8a09f6521a59908599eb5ba1a19b18dc6

gdb/unittests/array-view-selftests.c

index 43b7434d10f67ef03aec74e18c9bc022765ae9f2..fe211a647b54c3e8fe57ffd785a807e08993059b 100644 (file)
@@ -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.  */