public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44909]  New: Copy constructors implicitly deleted
@ 2010-07-11 13:54 marc dot glisse at normalesup dot org
  2010-07-13 22:24 ` [Bug c++/44909] [C++0x] " jason at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: marc dot glisse at normalesup dot org @ 2010-07-11 13:54 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

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


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

end of thread, other threads:[~2011-03-14  5:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-44909-4@http.gcc.gnu.org/bugzilla/>
2011-01-27  7:04 ` [Bug c++/44909] [C++0x] Copy constructors implicitly deleted hjl.tools at gmail dot com
2011-01-27 15:21 ` jason at gcc dot gnu.org
2011-03-14  5:09 ` jason at gcc dot gnu.org
2010-07-11 13:54 [Bug c++/44909] New: " marc dot glisse at normalesup dot org
2010-07-13 22:24 ` [Bug c++/44909] [C++0x] " jason at gcc dot gnu dot org
2010-07-14  0:02 ` jason at gcc dot gnu dot org
2010-07-14 14:08 ` marc dot glisse at normalesup dot org
2010-07-14 14:15 ` marc dot glisse at normalesup dot org
2010-07-14 14:30 ` paolo dot carlini at oracle dot com
2010-07-14 14:45 ` paolo dot carlini at oracle dot com
2010-07-15 20:46 ` jason at gcc dot gnu 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).