aboutsummaryrefslogtreecommitdiff
path: root/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp')
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
new file mode 100644
index 000000000000..3f132e47b626
--- /dev/null
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <tuple>
+
+// template <class... Types>
+// class tuple_size<tuple<Types...>>
+// : public integral_constant<size_t, sizeof...(Types)> { };
+
+// Expect failures with a reference type, pointer type, and a non-tuple type.
+
+#include <tuple>
+
+int main()
+{
+ (void)std::tuple_size<std::tuple<> &>::value; // expected-error {{implicit instantiation of undefined template}}
+ (void)std::tuple_size<int>::value; // expected-error {{implicit instantiation of undefined template}}
+ (void)std::tuple_size<std::tuple<>*>::value; // expected-error {{implicit instantiation of undefined template}}
+}