[libcxx] r289774 - Add test case for PR31384
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 14 22:38:07 PST 2016
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);
+}
More information about the cfe-commits
mailing list