--- Comment #4 from pinskia at gcc dot gnu dot org 2006-10-07 16:55 ---
(In reply to comment #2)
> 2) The second reason is that if GCC ignores the programmer written copy
> constructors, then the program will be misbehaved, and the results
> unpredictable, with even the possibility of a
--- Comment #3 from pinskia at gcc dot gnu dot org 2006-10-07 16:36 ---
(In reply to comment #2)
> Ok, I see that GCC has a work-around for this issue, but I must insist that
> the
> GCC compiler is incorrect in its interpretation of the C++ standard for two
> reasons.
The C++ standard
--- Comment #2 from SSacek at appsecinc dot com 2006-10-07 09:19 ---
Ok, I see that GCC has a work-around for this issue, but I must insist that the
GCC compiler is incorrect in its interpretation of the C++ standard for two
reasons.
1) Optimizations should be allowed for temporary obje
--- Comment #1 from pinskia at gcc dot gnu dot org 2006-10-07 08:17 ---
You want to use -fno-elide-constructors.
See
http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/C_002b_002b-Dialect-Options.html
This is not a bug as this is an allowed optimization by the C++ standard.
--
pinskia at g
ndif
--
Summary: The copy constructor is not being called upon return
from function calls.
Product: gcc
Version: 3.4.6
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo:
The program below works for the Solaris and Microsoft compilers, but not for
the GCC compiler. Can anybody else verify this, and or if it's already been
fixed?
I'm using:
-bash-3.00$ gcc -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr