mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288750 91177308-0d34-0410-b5e6-96231b3b80d8
35 lines
1010 B
C++
35 lines
1010 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'}}
|
|
}
|
|
}
|