public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/49107] New: [C++0x] incomplete type regression with std::pair
@ 2011-05-22 11:18 marc.glisse at normalesup dot org
  2011-05-22 12:15 ` [Bug libstdc++/49107] " paolo.carlini at oracle dot com
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: marc.glisse at normalesup dot org @ 2011-05-22 11:18 UTC (permalink / raw)
  To: gcc-bugs

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'


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2011-06-16 16:00 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-22 11:18 [Bug libstdc++/49107] New: [C++0x] incomplete type regression with std::pair marc.glisse at normalesup dot org
2011-05-22 12:15 ` [Bug libstdc++/49107] " paolo.carlini at oracle dot com
2011-05-22 12:23 ` paolo.carlini at oracle dot com
2011-05-22 12:44 ` marc.glisse at normalesup dot org
2011-05-22 13:23 ` [Bug c++/49107] " paolo.carlini at oracle dot com
2011-05-22 13:29 ` marc.glisse at normalesup dot org
2011-05-25 12:37 ` [Bug c++/49107] [C++0x][4.7 Regression] " paolo.carlini at oracle dot com
2011-05-25 12:38 ` paolo.carlini at oracle dot com
2011-06-04  5:56 ` jason at gcc dot gnu.org
2011-06-04  6:18 ` jason at gcc dot gnu.org
2011-06-04  6:58 ` paolo.carlini at oracle dot com
2011-06-04  7:06 ` paolo.carlini at oracle dot com
2011-06-04  7:34 ` paolo.carlini at oracle dot com
2011-06-04  9:32 ` marc.glisse at normalesup dot org
2011-06-04 12:28 ` redi at gcc dot gnu.org
2011-06-04 23:36 ` jason at gcc dot gnu.org
2011-06-04 23:42 ` jason at gcc dot gnu.org
2011-06-05  7:34 ` paolo.carlini at oracle dot com
2011-06-05  8:49 ` paolo.carlini at oracle dot com
2011-06-08 21:36 ` jason at gcc dot gnu.org
2011-06-10 20:41 ` marc.glisse at normalesup dot org
2011-06-14 19:31 ` jason at gcc dot gnu.org
2011-06-15  3:53 ` jason at gcc dot gnu.org
2011-06-15  3:58 ` jason at gcc dot gnu.org
2011-06-16 16:00 ` marc.glisse at normalesup dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).