* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / noexcept13.C
blobe52e9a0046c1d1959873d00a8b315b516a8cafd5
1 // PR c++/49107
2 // { dg-do compile { target c++11 } }
4 namespace std
6   template<typename _Tp> _Tp&& declval() noexcept;
8   struct true_type { static const bool value = true; };
9   struct false_type { static const bool value = false; };
11   template<typename _Tp, typename _Arg>
12     struct __is_direct_constructible_impl
13     {
14       template<typename _Tp2, typename _Arg2, typename
15                = decltype(::new _Tp2(declval<_Arg2>()))>
16       static true_type __test(int);
18       template<typename, typename>
19       static false_type __test(...);
21       typedef decltype(__test<_Tp, _Arg>(0)) type;
22     };
24   template<typename _Tp, typename _Arg>
25     struct __is_direct_constructible_new_safe
26     : public __is_direct_constructible_impl<_Tp, _Arg>::type
27     { };
29   template<class _T1, class _T2>
30     struct pair
31     {
32       pair() = default;
33       constexpr pair(const pair&) = default;
35       pair(pair&& __p)
36       noexcept(__is_direct_constructible_new_safe<_T2,_T2&&>::value);
37     };
40 template <class R_>
41 struct Vector3
43   typedef typename R_::Ray_3 Ray_3;
44   Vector3() {}
45   explicit Vector3(const Ray_3& r);
48 template < class R_ > class LineC3
50   typedef typename R_::Vector_3 Vector_3;
51   std::pair<int, Vector_3> x;
54 template < class R_ > class RayH3
56   typedef typename R_::Vector_3 Vector_3;
57   std::pair<int, Vector_3> x;
60 template <typename Kernel >
61 struct Homogeneous_base
63   typedef LineC3<Kernel> Line_3;
64   typedef RayH3<Kernel> Ray_3;
67 template < typename RT_>
68 struct Simple_homogeneous
69 : public Homogeneous_base< Simple_homogeneous<RT_> >
71   typedef Vector3<Simple_homogeneous<RT_> > Vector_3;
74 int main()
76   typedef Simple_homogeneous<double> R;
77   R::Line_3 l3;