http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49107
--- Comment #20 from Marc Glisse <marc.glisse at normalesup dot org> 2011-06-10 20:39:59 UTC --- The patch fixes the example (thanks), but I still have trouble with the following (and I also get a different type of failure elsewhere that I'll investigate later): #include <utility> template <class R_> struct Vector3 { typedef typename R_::Ray_3 Ray_3; Vector3() {} explicit Vector3(const Ray_3& r); }; template < class R_ > class LineC3 { typedef typename R_::Vector_3 Vector_3; std::pair<int, Vector_3> x; }; template < class R_ > class RayH3 { typedef typename R_::Vector_3 Vector_3; std::pair<int, Vector_3> x; }; template <typename Kernel > struct Homogeneous_base { typedef LineC3<Kernel> Line_3; typedef RayH3<Kernel> Ray_3; }; template < typename RT_> struct Simple_homogeneous : public Homogeneous_base< Simple_homogeneous<RT_> > { typedef Vector3<Simple_homogeneous<RT_> > Vector_3; }; int main() { typedef Simple_homogeneous<double> R; R::Line_3 l3; } which fails with: In file included from /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/utility:72:0, from Simple_homogeneous.cpp:1: /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_pair.h: In constructor 'std::pair<_T1, _T2>::pair(std::pair<_T1, _T2>&&) [with _T1 = int, _T2 = Vector3<Simple_homogeneous<double> >, std::pair<_T1, _T2> = std::pair<int, Vector3<Simple_homogeneous<double> > >]': /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:740:46: required from 'struct std::__is_direct_constructible_impl<Vector3<Simple_homogeneous<double> >, Vector3<Simple_homogeneous<double> >&&>' /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:89:12: required from 'struct std::__and_<std::is_destructible<Vector3<Simple_homogeneous<double> > >, std::__is_direct_constructible_impl<Vector3<Simple_homogeneous<double> >, Vector3<Simple_homogeneous<double> >&&> >' /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:744:12: required from 'struct std::__is_direct_constructible_new_safe<Vector3<Simple_homogeneous<double> >, Vector3<Simple_homogeneous<double> >&&>' /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:816:12: required from 'struct std::__is_direct_constructible_new<Vector3<Simple_homogeneous<double> >, Vector3<Simple_homogeneous<double> >&&>' /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:824:12: required from 'struct std::__is_direct_constructible<Vector3<Simple_homogeneous<double> >, Vector3<Simple_homogeneous<double> >&&>' /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:863:12: [ skipping 3 instantiation contexts ] /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:960:12: required from 'struct std::is_nothrow_constructible<Vector3<Simple_homogeneous<double> >, Vector3<Simple_homogeneous<double> >&&>' /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:991:12: required from 'struct std::__is_nothrow_move_constructible_impl<Vector3<Simple_homogeneous<double> >, false>' /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:997:12: required from 'struct std::is_nothrow_move_constructible<Vector3<Simple_homogeneous<double> > >' /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:89:12: required from 'struct std::__and_<std::is_nothrow_move_constructible<int>, std::is_nothrow_move_constructible<Vector3<Simple_homogeneous<double> > > >' /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_pair.h:122:7: required from 'std::pair<_T1, _T2>::pair(std::pair<_T1, _T2>&&) [with _T1 = int, _T2 = Vector3<Simple_homogeneous<double> >, std::pair<_T1, _T2> = std::pair<int, Vector3<Simple_homogeneous<double> > >]' Simple_homogeneous.cpp:40:12: required from here /tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_pair.h:122:7: error: incomplete type 'std::__and_<std::is_nothrow_move_constructible<int>, std::is_nothrow_move_constructible<Vector3<Simple_homogeneous<double> > > >' used in nested name specifier