brintos

brintos / llvm-project-archived public Read only

0
0
Text · 923 B · e58e760 Raw
27 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// REQUIRES: std-at-least-c++2610 11// <tuple>12 13// template <class T, class Tuple> constexpr T make_from_tuple(Tuple&&);14// Mandates: If tuple_size_v<remove_reference_t<Tuple>> is 1, then reference_constructs_from_temporary_v<T, decltype(get<0>(declval<Tuple>()))> is false.15 16#include <tuple>17#include <utility>18 19#include "test_macros.h"20 21void test() {22  // expected-error@*:* {{static assertion failed}}23 24  // expected-error@tuple:* {{returning reference to local temporary object}}25  std::ignore = std::make_from_tuple<const int&>(std::tuple<char>{});26}27