This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

sequence point across assignment


I had some code:

    states_[ix].next_ = compileStep(vec);

The compileStep() function pushed something onto states_
which caused its internal memory to be reallocated. As a result
the returned value was copied to the wrong place. It appears
that the left hand side is reduced to an address before the
call is made.

The compiler is  g++ (SUSE Linux) 4.8.3 with options
   g++ -g -O0   -Wall -m64 -std=gnu++11 -fpic 

Have I strayed into undefined behaviour or is the compiler
being silly? (Might this a consequence of the return value
optimisation)?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]