Files
android_external_libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp
Eric Fiselier 1739d3ef0a Add test case for PR31384
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 06:38:07 +00:00

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