------- Comment #5 from pinskia at gcc dot gnu dot org 2007-03-13 21:40 ------- A quick patch which I am testing right now: Index: cp/call.c =================================================================== --- cp/call.c (revision 122871) +++ cp/call.c (working copy) @@ -4671,7 +4671,7 @@ VAR_DECL. We can avoid the copy for constants, since they are never modified in place. */ if (!CONSTANT_CLASS_P (arg)) - arg = copy_node (arg); + arg = unshare_expr (arg); arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL, "default argument", fn, parmnum); arg = convert_for_arg_passing (type, arg);
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31165