| 1 |
// PR c++/49107 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
namespace std |
| 5 |
{ |
| 6 |
template<typename _Tp> _Tp&& declval() noexcept; |
| 7 |
|
| 8 |
struct true_type { static const bool value = true; }; |
| 9 |
struct false_type { static const bool value = false; }; |
| 10 |
|
| 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); |
| 17 |
|
| 18 |
template<typename, typename> |
| 19 |
static false_type __test(...); |
| 20 |
|
| 21 |
typedef decltype(__test<_Tp, _Arg>(0)) type; |
| 22 |
}; |
| 23 |
|
| 24 |
template<typename _Tp, typename _Arg> |
| 25 |
struct __is_direct_constructible_new_safe |
| 26 |
: public __is_direct_constructible_impl<_Tp, _Arg>::type |
| 27 |
{ }; |
| 28 |
|
| 29 |
template<class _T1, class _T2> |
| 30 |
struct pair |
| 31 |
{ |
| 32 |
pair() = default; |
| 33 |
constexpr pair(const pair&) = default; |
| 34 |
|
| 35 |
pair(pair&& __p) |
| 36 |
noexcept(__is_direct_constructible_new_safe<_T2,_T2&&>::value); |
| 37 |
}; |
| 38 |
} |
| 39 |
|
| 40 |
template <class R_> |
| 41 |
struct Vector3 |
| 42 |
{ |
| 43 |
typedef typename R_::Ray_3 Ray_3; |
| 44 |
Vector3() {} |
| 45 |
explicit Vector3(const Ray_3& r); |
| 46 |
}; |
| 47 |
|
| 48 |
template < class R_ > class LineC3 |
| 49 |
{ |
| 50 |
typedef typename R_::Vector_3 Vector_3; |
| 51 |
std::pair<int, Vector_3> x; |
| 52 |
}; |
| 53 |
|
| 54 |
template < class R_ > class RayH3 |
| 55 |
{ |
| 56 |
typedef typename R_::Vector_3 Vector_3; |
| 57 |
std::pair<int, Vector_3> x; |
| 58 |
}; |
| 59 |
|
| 60 |
template <typename Kernel > |
| 61 |
struct Homogeneous_base |
| 62 |
{ |
| 63 |
typedef LineC3<Kernel> Line_3; |
| 64 |
typedef RayH3<Kernel> Ray_3; |
| 65 |
}; |
| 66 |
|
| 67 |
template < typename RT_> |
| 68 |
struct Simple_homogeneous |
| 69 |
: public Homogeneous_base< Simple_homogeneous<RT_> > |
| 70 |
{ |
| 71 |
typedef Vector3<Simple_homogeneous<RT_> > Vector_3; |
| 72 |
}; |
| 73 |
|
| 74 |
int main() |
| 75 |
{ |
| 76 |
typedef Simple_homogeneous<double> R; |
| 77 |
R::Line_3 l3; |
| 78 |
} |