Add test case for PR31384

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289774 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-12-15 06:38:07 +00:00
parent 9663ee4d4f
commit 1739d3ef0a

View File

@@ -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);
}