This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14213] strange behavior with private cp-cstr...
- From: "pluto at ds14 dot agh dot edu dot pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Feb 2004 10:13:40 -0000
- Subject: [Bug c++/14213] strange behavior with private cp-cstr...
- References: <20040219170343.14213.pluto@ds14.agh.edu.pl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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