]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/20_util/tuple/element_access/get2_by_type.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / tuple / element_access / get2_by_type.cc
CommitLineData
52066eae 1// { dg-do compile { target c++14 } }
18eeaec4 2
83ffe9cd 3// Copyright (C) 2013-2023 Free Software Foundation, Inc.
18eeaec4
PC
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10//
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License along
17// with this library; see the file COPYING3. If not see
18// <http://www.gnu.org/licenses/>.
19
b5a8fed6 20#include <tuple>
18eeaec4
PC
21
22void test01()
23{
b5a8fed6
JW
24 std::tuple<int> t1;
25
26 int&& t1one __attribute__((unused)) = std::get<int>(std::move(t1));
27
28 std::tuple<float, int> t2;
29
30 float&& t2one __attribute__((unused)) = std::get<0>(std::move(t2));
31 int&& t2two __attribute__((unused)) = std::get<int>(std::move(t2));
32
33 std::tuple<short, int, double> t3;
18eeaec4 34
b5a8fed6
JW
35 short&& t3one __attribute__((unused)) = std::get<short>(std::move(t3));
36 int&& t3two __attribute__((unused)) = std::get<int>(std::move(t3));
37 double&& t3thr __attribute__((unused)) = std::get<double>(std::move(t3));
ccbbf8df
VV
38
39 const std::tuple<int> ct1;
40
41 const int&& ct1one __attribute__((unused)) = std::get<int>(std::move(ct1));
42
43 const std::tuple<float, int> ct2;
44
45 const float&& ct2one __attribute__((unused)) = std::get<0>(std::move(ct2));
46 const int&& ct2two __attribute__((unused)) = std::get<int>(std::move(ct2));
47
48 const std::tuple<short, int, double> ct3;
49
50 const short&& ct3one __attribute__((unused)) =
51 std::get<short>(std::move(ct3));
52 const int&& ct3two __attribute__((unused)) =
53 std::get<int>(std::move(ct3));
54 const double&& ct3thr __attribute__((unused)) =
55 std::get<double>(std::move(ct3));
18eeaec4 56}