OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libstdc++-v3/] [testsuite/] [20_util/] [pair/] [40925.cc] - Blame information for rev 742

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 742 jeremybenn
// { dg-options "-std=gnu++0x" }
2
// { dg-do compile }
3
 
4
// Copyright (C) 2009 Free Software Foundation, Inc.
5
//
6
// This file is part of the GNU ISO C++ Library.  This library is free
7
// software; you can redistribute it and/or modify it under the
8
// terms of the GNU General Public License as published by the
9
// Free Software Foundation; either version 3, or (at your option)
10
// any later version.
11
 
12
// This library is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
// GNU General Public License for more details.
16
 
17
// You should have received a copy of the GNU General Public License along
18
// with this library; see the file COPYING3.  If not see
19
// <http://www.gnu.org/licenses/>.
20
 
21
#include <utility>
22
 
23
struct X
24
{
25
  explicit X(int, int) { }
26
 
27
private:
28
  X(const X&) = delete;
29
};
30
 
31
struct move_only
32
{
33
  move_only() { }
34
  move_only(move_only&&) { }
35
 
36
private:
37
  move_only(const move_only&) = delete;
38
};
39
 
40
// libstdc++/40925
41
void test01()
42
{
43
  int *ip = 0;
44
  int X::*mp = 0;
45
 
46
  std::pair<int*, int*> p1(0, 0);
47
  std::pair<int*, int*> p2(ip, 0);
48
  std::pair<int*, int*> p3(0, ip);
49
  std::pair<int*, int*> p4(ip, ip);
50
 
51
  std::pair<int X::*, int*> p5(0, 0);
52
  std::pair<int X::*, int X::*> p6(mp, 0);
53
  std::pair<int X::*, int X::*> p7(0, mp);
54
  std::pair<int X::*, int X::*> p8(mp, mp);
55
 
56
  std::pair<int*, move_only> p9(0, move_only());
57
  std::pair<int X::*, move_only> p10(0, move_only());
58
  std::pair<move_only, int*> p11(move_only(), 0);
59
  std::pair<move_only, int X::*> p12(move_only(), 0);
60
 
61
  std::pair<int*, move_only> p13(ip, move_only());
62
  std::pair<int X::*, move_only> p14(mp, move_only());
63
  std::pair<move_only, int*> p15(move_only(), ip);
64
  std::pair<move_only, int X::*> p16(move_only(), mp);
65
 
66
  std::pair<move_only, move_only> p17(move_only(), move_only());
67
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.