33 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// <tuple>10 11// template <class... Types> class tuple;12 13// template <size_t I, class... Types>14// const typename tuple_element<I, tuple<Types...> >::type&&15// get(const tuple<Types...>&& t);16 17// UNSUPPORTED: c++0318 19#include <tuple>20 21template <class T> void cref(T const&) {}22template <class T> void cref(T const&&) = delete;23 24std::tuple<int> const tup4() { return std::make_tuple(4); }25 26void f() {27 // LWG2485: tuple should not open a hole in the type system, get() should28 // imitate [expr.ref]'s rules for accessing data members29 {30 cref(std::get<0>(tup4())); // expected-error {{call to deleted function 'cref'}}31 }32}33