The following code compiles fine in C++98 with any version of g++, compiles
fine in C++0X with g++-4.4, but fails in C++0X with g++-4.6 with the error
message:

bug.cc: In function ‘void ouin(const Ray&)’:
bug.cc:35:9: error: use of deleted function ‘Ray::Ray(const Ray&)’
bug.cc:28:8: error: ‘Ray::Ray(const Ray&)’ is implicitly deleted because the
default definition would be ill-formed:

I hope I didn't remove anything essential while reducing the example (started
with 500k lines...).

struct Coord
{
        Coord();
        Coord(const Coord&);
};

template<typename _Tp>
struct array
{
        array();
        _Tp _M_instance[1];
};

struct Ray;

struct Vector
{
        array<Coord> base;
        Vector();
        Vector(const Ray &) ;
};

struct Point
{
        Vector base;
};

struct Ray
{
        array<Point> base;
};

void ouin (Ray const& r1)
{
        Ray r2=r1;
}


-- 
           Summary: Copy constructors implicitly deleted
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: marc dot glisse at normalesup dot org
  GCC host triplet: x86_64-unknown-linux-gnu


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

Reply via email to