[Bug libstdc++/49107] New: [C++0x] incomplete type regression with std::pair
marc.glisse at normalesup dot org
gcc-bugzilla@gcc.gnu.org
Sun May 22 11:18:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49107
Summary: [C++0x] incomplete type regression with std::pair
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: marc.glisse@normalesup.org
Hello,
this code very recently stopped compiling. I am reporting it against libstdc++
because it uses std::pair, but feel free to reassign to the C++ FE if
appropriate, I didn't have time to investigate further.
#include <utility>
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_::Point_3 Point_3;
typedef typename R_::Vector_3 Vector_3;
typedef std::pair<Point_3, Vector_3> Rep;
Rep base;
};
template < class R_ >
struct LineC3
{
typedef typename R_::Point_3 Point_3;
typedef typename R_::Vector_3 Vector_3;
typedef std::pair<Point_3, Vector_3> Rep;
Rep base;
};
template < typename Kernel >
struct Homogeneous_base
{
typedef double RT;
struct Point_3{};
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); }
};
};
struct Simple_homogeneous
: public Homogeneous_base< Simple_homogeneous >
{};
int main()
{
Simple_homogeneous::Construct_vector_3()( 8, 2, 4, 1);
}
$ c++ -std=gnu++0x -c Simple_homogeneous.cpp
Simple_homogeneous.cpp: In instantiation of 'LineC3<Simple_homogeneous>':
/tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:730:46:
instantiated from
'std::__is_direct_constructible_impl<VectorH3<Simple_homogeneous>,
VectorH3<Simple_homogeneous>&&>'
/tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:79:12:
instantiated from
'std::__and_<std::is_destructible<VectorH3<Simple_homogeneous> >,
std::__is_direct_constructible_impl<VectorH3<Simple_homogeneous>,
VectorH3<Simple_homogeneous>&&> >'
/tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:734:12:
instantiated from
'std::__is_direct_constructible_new_safe<VectorH3<Simple_homogeneous>,
VectorH3<Simple_homogeneous>&&>'
/tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:806:12:
instantiated from
'std::__is_direct_constructible_new<VectorH3<Simple_homogeneous>,
VectorH3<Simple_homogeneous>&&>'
/tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:814:12:
instantiated from
'std::__is_direct_constructible<VectorH3<Simple_homogeneous>,
VectorH3<Simple_homogeneous>&&>'
/tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:853:12:
[ skipping 4 instantiation contexts ]
/tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:981:12:
instantiated from
'std::__is_nothrow_move_constructible_impl<VectorH3<Simple_homogeneous>,
false>'
/tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:987:12:
instantiated from
'std::is_nothrow_move_constructible<VectorH3<Simple_homogeneous> >'
/tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_pair.h:185:7:
instantiated from 'std::pair<Homogeneous_base<Simple_homogeneous>::Point_3,
VectorH3<Simple_homogeneous> >'
Simple_homogeneous.cpp:21:8: instantiated from 'RayH3<Simple_homogeneous>'
Simple_homogeneous.cpp:44:30: instantiated from
'Homogeneous_base<Kernel>::Vector_3
Homogeneous_base<Kernel>::Construct_vector_3::operator()(const RT&, const RT&,
const RT&, const RT&) const [with Kernel = Simple_homogeneous,
Homogeneous_base<Kernel>::Vector_3 = VectorH3<Simple_homogeneous>,
Homogeneous_base<Kernel>::RT = double]'
Simple_homogeneous.cpp:54:55: instantiated from here
Simple_homogeneous.cpp:30:7: error: 'LineC3<R_>::base' has incomplete type
/tmp/gcc/inst/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_pair.h:88:12:
error: declaration of 'LineC3<Simple_homogeneous>::Rep'
More information about the Gcc-bugs
mailing list