http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49107

--- Comment #5 from Marc Glisse <marc.glisse at normalesup dot org> 2011-05-22 
13:03:53 UTC ---
(In reply to comment #4)
> Thanks Marc. Well, now I would say it's a C++ front-end issue.

Ok.

> Consider the below: uncomment the seemingly unrelated VectorH3 constructor 
> from
> const Line_3&, and doesn't compile anymore.

Yes, I left it there for a reason ;-)

Stripping <type_traits> to have 0 includes:

namespace std
{
        template<typename _Tp>
                _Tp declval() noexcept;

        template<typename _Tp , typename = decltype(::new
_Tp(declval<_Tp&&>()))>
                struct ploum
                {
                        static const bool value=true;
                };

        template<class _T2>
                struct pair
                {
                        _T2 second;
                        void swap(pair& __p)
                                noexcept(ploum<_T2>::value);
                };
}

template < class R_ >
struct VectorH3
{
        typedef typename R_::RT                   RT;
        typedef typename R_::Ray_3                Ray_3;
        typedef typename R_::Line_3               Line_3;
        VectorH3() {}
        VectorH3(const Ray_3& r) ;
        VectorH3(const Line_3& l) ;
        VectorH3(const RT& x, const RT& y) ;
};

template < class R_ >
class RayH3
{
        typedef typename R_::Vector_3             Vector_3;
        typedef std::pair<Vector_3>             Rep;
        Rep base;
};

template < class R_ >
struct LineC3
{
        typedef typename R_::Vector_3             Vector_3;
        typedef std::pair<Vector_3>             Rep;
        Rep base;
};

struct Kernel
{
        typedef double                                  RT;
        typedef VectorH3<Kernel>                        Vector_3;
        typedef LineC3<Kernel>                          Line_3;
        typedef RayH3<Kernel>                           Ray_3;
        struct Construct_vector_3
        {
                Vector_3 operator()(const RT& x, const RT& y)
                        const
                        { return Vector_3(x, y); }
        };
};


int main()
{
        Kernel::Construct_vector_3()( 8, 2);
}

Reply via email to