Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / noexcept15.C
blob6c6eef689153c3791da997ac6ccdf69fc26f03cb
1 // PR c++/50391
2 // { dg-do compile { target c++11 } }
4 namespace std
6   template<typename T, T Val>
7     struct integral_constant
8     { static constexpr T value = Val; };
10   template<typename T>
11     struct is_abstract
12     : integral_constant<bool, __is_abstract(T)>
13     { };
15   template<typename T, bool = is_abstract<T>::value>
16     struct is_destructible
17     : integral_constant<bool, true>
18     { };
20   template<typename T>
21     struct is_destructible<T, true>
22     : integral_constant<bool, false>
23     { };
25   template<typename T>
26     struct is_nothrow_move_constructible
27     : is_destructible<T>
28     { };
30   template<typename T>
31     struct decay
32     { typedef T type; };
34   template<typename T>
35     struct decay<T&>
36     { typedef T type; };
38 } // std
40 template<class Tp>
41   struct single
42   {
43     Tp elem;
45     constexpr single(const Tp& e)
46     : elem(e) { }
48     single(single&& s)
49     noexcept(std::is_nothrow_move_constructible<Tp>::value) 
50     : elem(s.elem) { }
51   };
53 template<class Tp>
54   constexpr single<typename std::decay<Tp>::type>
55   make_single(Tp&& x)
56   {
57     return single<typename std::decay<Tp>::type>(x);
58   }
60 class Blob;  // { dg-message "forward declaration" }
62 void
63 foo(Blob *b)
65   make_single(*b);
68 // { dg-excess-errors "incomplete type|not a member" }