[Bug c++/49107] [C++0x] incomplete type regression with std::pair
paolo.carlini at oracle dot com
gcc-bugzilla@gcc.gnu.org
Sun May 22 13:23:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49107
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|libstdc++ |c++
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-22 12:28:51 UTC ---
Thanks Marc. Well, now I would say it's a C++ front-end issue.
Consider the below: uncomment the seemingly unrelated VectorH3 constructor from
const Line_3&, and doesn't compile anymore.
////////////////
#include <type_traits>
template<typename _Tp>
inline void
swap(_Tp& __a, _Tp& __b)
noexcept(std::is_nothrow_move_constructible<_Tp>::value) ;
template<class _T1>
struct pair
{
_T1 first;
void
swap(pair& __p)
noexcept(noexcept(swap(first, __p.first)));
};
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, const RT& z, const RT& w) ;
};
template < class R_ >
class RayH3
{
typedef typename R_::Vector_3 Vector_3;
typedef pair<Vector_3> Rep;
Rep base;
};
template < class R_ >
struct LineC3
{
typedef typename R_::Vector_3 Vector_3;
typedef 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 RT& z, const RT& w) const
{ return Vector_3(x, y, z, w); }
};
};
int main()
{
Kernel::Construct_vector_3()( 8, 2, 4, 1);
}
More information about the Gcc-bugs
mailing list