git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289774 91177308-0d34-0410-b5e6-96231b3b80d8
39 lines
814 B
C++
39 lines
814 B
C++
// -*- 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);
|
|
}
|