summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/tuple
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-12-15 06:38:07 +0000
committerEric Fiselier <eric@efcs.ca>2016-12-15 06:38:07 +0000
commit9ce1745464adcb1e22bbf448a664ba44adad3f46 (patch)
treea22e99ab7e95d54221651665f01be4662fd6c87d /libcxx/test/std/utilities/tuple
parent347a1cc2212abd771ae9cc2e202ddd78704242cc (diff)
downloadbcm5719-llvm-9ce1745464adcb1e22bbf448a664ba44adad3f46.tar.gz
bcm5719-llvm-9ce1745464adcb1e22bbf448a664ba44adad3f46.zip
Add test case for PR31384
llvm-svn: 289774
Diffstat (limited to 'libcxx/test/std/utilities/tuple')
-rw-r--r--libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp
new file mode 100644
index 00000000000..9fde7ac9afa
--- /dev/null
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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 TupleLike> tuple(TupleLike&&); // libc++ extension
+
+// See llvm.org/PR31384
+
+#include <tuple>
+#include <cassert>
+
+
+int count = 0;
+
+template<class T>
+struct derived : std::tuple<T> {
+ using std::tuple<T>::tuple;
+ template<class U>
+ operator std::tuple<U>() && {
+ ++count;
+ return {};
+ }
+};
+
+int main() {
+ std::tuple<int> foo = derived<int&&>{42};
+ assert(count == 1);
+}
OpenPOWER on IntegriCloud