On 05/02/2011 06:23 PM, Eric Botcazou wrote:
I'm not sure you can copy statements if they have any side-effects; this looks
quite dangerous to me.  Instead statement-expressions should be wrapped up in
a SAVE_EXPR/TARGET_EXPR to protect them and prevent copying.

It sounds like Ada and C++ are using copy_tree_r in very different ways.

The use in C++ has to do with default arguments: we parse the expression at the point of the function declaration, but whenever we want to use the expression in a function call we need to make a deep copy of the expression. In this case, we want to copy everything.

How is it used in Ada?

Jason

Reply via email to