summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/views/span.tuple/tuple_element.fail.cpp
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2019-02-27 15:41:37 +0000
committerMarshall Clow <mclow.lists@gmail.com>2019-02-27 15:41:37 +0000
commit02e1651c1f25a960391a6bd8fcd4989539fe5183 (patch)
treed532c51d9d8ce8ac27d37a322ff8950f031a1313 /libcxx/test/std/containers/views/span.tuple/tuple_element.fail.cpp
parentbfdfa8d99ce8ca8c7de63ed4ae8b8ffec4bb7089 (diff)
downloadbcm5719-llvm-02e1651c1f25a960391a6bd8fcd4989539fe5183.tar.gz
bcm5719-llvm-02e1651c1f25a960391a6bd8fcd4989539fe5183.zip
Implment the last part of P1024: tuple-like interface to span. Reviewed as https://reviews.llvm.org/D58706.
llvm-svn: 354988
Diffstat (limited to 'libcxx/test/std/containers/views/span.tuple/tuple_element.fail.cpp')
-rw-r--r--libcxx/test/std/containers/views/span.tuple/tuple_element.fail.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/libcxx/test/std/containers/views/span.tuple/tuple_element.fail.cpp b/libcxx/test/std/containers/views/span.tuple/tuple_element.fail.cpp
new file mode 100644
index 00000000000..4ecec6bda3f
--- /dev/null
+++ b/libcxx/test/std/containers/views/span.tuple/tuple_element.fail.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+
+// <span>
+
+// tuple_element<I, span<T, N> >::type
+
+#include <span>
+
+#include "test_macros.h"
+
+
+int main(int, char**)
+{
+// No tuple_element for dynamic spans
+ using T1 = typename std::tuple_element< 0, std::span<int, 0>>::type; // expected-error-re@span:* {{static_assert failed{{( due to requirement '.*')?}} "Index out of bounds in std::tuple_element<> (std::span)"}}
+ using T2 = typename std::tuple_element< 5, std::span<int, 5>>::type; // expected-error-re@span:* {{static_assert failed{{( due to requirement '.*')?}} "Index out of bounds in std::tuple_element<> (std::span)"}}
+ using T3 = typename std::tuple_element<20, std::span<int, 10>>::type; // expected-error-re@span:* {{static_assert failed{{( due to requirement '.*')?}} "Index out of bounds in std::tuple_element<> (std::span)"}}
+
+ return 0;
+}
OpenPOWER on IntegriCloud