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

Add test case for PR31384
Add test case for PR31384

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@289774 91177308-0d34-0410-b5e6-96231b3b80d8
