This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36744] function modifying argument received by-value affects caller's variable when passed as rvalue
- From: "chris dot fairles at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jul 2008 19:51:44 -0000
- Subject: [Bug c++/36744] function modifying argument received by-value affects caller's variable when passed as rvalue
- References: <bug-36744-5473@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from chris dot fairles at gmail dot com 2008-07-06 19:51 -------
(In reply to comment #2)
> (In reply to comment #0)
> > struct S
> > {
> > S(): i(2) {}
> //S(S const&) {}
> S(S const&);
> The cctor need only be defined as well to get the same behavior (gcc 4.4.0,
> -std=c++0x, -fno-elide-constructors, -O0, -fno-inline).
And by defined I mean declared of course.
Chris
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36744