[Bug c++/14213] strange behavior with private cp-cstr...
pluto at ds14 dot agh dot edu dot pl
gcc-bugzilla@gcc.gnu.org
Fri Feb 20 10:13:00 GMT 2004
------- Additional Comments From pluto at ds14 dot agh dot edu dot pl 2004-02-20 10:13 -------
(In reply to comment #3)
> (In reply to comment #2)
> > When writing
> > A a2 = a1;
> > this has the same requirements as using the
> > A a2(a1);
> > syntax. Thus, the copy constructor needs to be accessible.
> >
> > W.
>
> Where exactly in the C++ draft is it written?
ok, i found it.
==========================
12.8 Copying class objects
class X {
   //...
public:
 X(int);
 X(const&, int =1);
};
X a(1);  // calls X(int);
X b(a,0); // calls X(const X&, int);
X c = b; // calls X(const X&, int);
========================
EOT.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14213
More information about the Gcc-bugs
mailing list