
Review: http://reviews.llvm.org/D14839 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@255941 91177308-0d34-0410-b5e6-96231b3b80d8
35 lines
1011 B
C++
35 lines
1011 B
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.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// <tuple>
|
|
|
|
// template <class... Types> class tuple;
|
|
|
|
// template <size_t I, class... Types>
|
|
// const typename tuple_element<I, tuple<Types...> >::type&&
|
|
// get(const tuple<Types...>&& t);
|
|
|
|
// UNSUPPORTED: c++98, c++03
|
|
|
|
#include <tuple>
|
|
|
|
template <class T> void cref(T const&) {};
|
|
template <class T> void cref(T const&&) = delete;
|
|
|
|
std::tuple<int> const tup4() { return std::make_tuple(4); }
|
|
|
|
int main()
|
|
{
|
|
// LWG2485: tuple should not open a hole in the type system, get() should
|
|
// imitate [expr.ref]'s rules for accessing data members
|
|
{
|
|
cref(std::get<0>(tup4())); // expected-error {{call to deleted function 'cref'}}
|
|
}
|
|
}
|