------- Comment #7 from pinskia at gcc dot gnu dot org  2007-04-22 18:18 -------
13.5.1/1 explains that:
@x is the same as operator@(x) or x.operator@() [depending on if x has a member
function for operator@ or not] .

So:
a = b++; is the exactly the same as:
a = b.operator++(0);

so function operator++ can do anything, it does not have to follow what is a
postfix incremement at all.  13.5/7 goes in a little detail at what is required
for basic types does not have to hold for overloaded operators.

So again this bug is invalid.  The code is acting exactly what the C++ standard
says it should act and any change is going to make GCC a non C++ compiler.

>In these cases the current interpretation will by necessity involve a
> complete copy.

No, no, no, it does not this is one of my points I have been trying to explain,
12.8/15 explains sometimes temporaries can be avioded and this case it can.

For any:
a = b.function(); 

where function could be an operator call (invoke implictly via the operator
too) and the function returns a large data type so the copy constructor is not
called and there is no extra variable on the stack.  So I don't see your point
with postfix being special really, as there is nothing special about those
operators.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31652

Reply via email to