+2007-03-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/30108
+ * call.c (convert_default_arg): Copy non-constant arguments.
+
2007-03-11 Mark Mitchell <mark@codesourcery.com>
PR c++/31038
}
else
{
- /* This could get clobbered by the following call. */
- if (TREE_HAS_CONSTRUCTOR (arg))
+ /* We must make a copy of ARG, in case subsequent processing
+ alters any part of it. For example, during gimplification a
+ cast of the form (T) &X::f (where "f" is a member function)
+ will lead to replacing the PTRMEM_CST for &X::f with a
+ 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 = convert_for_initialization (0, type, arg, LOOKUP_NORMAL,
"default argument", fn, parmnum);
arg = convert_for_arg_passing (type, arg);
+2007-03-12 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/30108
+ * g++.dg/other/default6.C: New test.
+
2007-03-12 Richard Sandiford <richard@codesourcery.com>
* lib/target-supports.exp (check_profiling_available): Return false
--- /dev/null
+// PR c++/30108
+
+class BaseRobot {
+ typedef void (BaseRobot::*PseudoState)(void);
+ typedef PseudoState STATE;
+ STATE initial ();
+ int ready ();
+ STATE stpOtherTask ();
+ STATE commonEventProcessing (STATE pIdleTarget=(STATE)&BaseRobot::ready);
+};
+BaseRobot::STATE BaseRobot::initial ()
+{
+ return commonEventProcessing ();
+}
+BaseRobot::STATE BaseRobot::stpOtherTask ()
+{
+ return commonEventProcessing ();
+}