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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [error5.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/49181
2
// { dg-options -std=c++0x }
3
 
4
namespace std
5
{
6
  typedef __SIZE_TYPE__ size_t;
7
 
8
  template
9
    struct integral_constant;
10
 
11
  template
12
    struct integral_constant
13
    {
14
      static constexpr _Tp value = __v;
15
      typedef _Tp value_type;
16
      typedef integral_constant<_Tp, __v> type;
17
      constexpr operator value_type() { return value; }
18
    };
19
 
20
  typedef integral_constant true_type;
21
 
22
  typedef integral_constant false_type;
23
 
24
  template
25
    constexpr _Tp integral_constant<_Tp, __v>::value;
26
 
27
  template
28
    struct enable_if
29
    { };
30
 
31
  template
32
    struct enable_if
33
    { typedef _Tp type; };
34
 
35
  template
36
    inline _Tp
37
    declval();
38
 
39
struct bad_alloc { };
40
}
41
 
42
void* operator new(std::size_t) throw (std::bad_alloc);
43
 
44
namespace std
45
{
46
 
47
  template
48
    class allocator
49
    {
50
    public:
51
      typedef _Tp* pointer;
52
      typedef _Tp value_type;
53
 
54
      pointer
55
      allocate(size_t, const void* = 0);
56
    };
57
 
58
  template
59
    struct allocator_traits
60
    {
61
      typedef typename _Alloc::value_type value_type;
62
 
63
      template static typename _Tp::pointer
64
_S_pointer_helper(_Tp*);
65
      static value_type* _S_pointer_helper(...);
66
      typedef decltype(_S_pointer_helper((_Alloc*)0)) __pointer;
67
 
68
      typedef __pointer pointer;
69
 
70
      typedef const void* const_void_pointer;
71
 
72
      private:
73
      template
74
    struct __allocate_helper
75
    {
76
      template
77
        typename = decltype(std::declval<_Alloc3*>()->allocate(
78
          std::declval(),
79
          std::declval()))>
80
          static true_type __test(int);
81
 
82
      template
83
        static false_type __test(...);
84
 
85
      typedef decltype(__test<_Alloc>(0)) type;
86
      static const bool value = type::value;
87
    };
88
 
89
      template
90
    static typename
91
    enable_if<__allocate_helper<_Alloc2>::value, pointer>::type
92
    _S_allocate(_Alloc2& __a, size_t __n, const_void_pointer __hint)
93
    { return __a.allocate(__n, __hint); }
94
 
95
      public:
96
      static pointer
97
    allocate(_Alloc& __a, size_t __n, const_void_pointer __hint)
98
    { return _S_allocate(__a, __n, __hint); }
99
    };
100
 
101
}
102
 
103
namespace std
104
{
105
  typedef short test_type;
106
  template struct allocator_traits>;
107
}

powered by: WebSVN 2.1.0

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