Author: ericwf
Date: Thu Dec 15 00:38:07 2016
New Revision: 289774

URL: http://llvm.org/viewvc/llvm-project?rev=289774&view=rev
Log:
Add test case for PR31384

Added:
    
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp

Added: 
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp?rev=289774&view=auto
==============================================================================
--- 
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp 
(added)
+++ 
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp 
Thu Dec 15 00:38:07 2016
@@ -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);
+}


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to