+2008-07-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c++/36944
+ * class.c (type_has_user_provided_default_constructor): Handle
+ default parameters.
+
2008-07-27 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (push_library_fn): Add a parameter for the exceptions that
bool
type_has_user_provided_default_constructor (tree t)
{
- tree fns;
+ tree fns, args;
if (!TYPE_HAS_USER_CONSTRUCTOR (t))
return false;
{
tree fn = OVL_CURRENT (fns);
if (TREE_CODE (fn) == FUNCTION_DECL
- && user_provided_p (fn)
- && (skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn))
- == NULL_TREE))
- return true;
+ && user_provided_p (fn))
+ {
+ args = FUNCTION_FIRST_USER_PARMTYPE (fn);
+ while (args && TREE_PURPOSE (args))
+ args = TREE_CHAIN (args);
+ if (!args || args == void_list_node)
+ return true;
+ }
}
return false;
--- /dev/null
+/* { dg-do compile } */
+
+class XObject
+{
+public:
+ int foo;
+};
+
+class XObjectPtr
+{
+public:
+ explicit
+ XObjectPtr(XObject* theXObject = 0) : m_xobjectPtr(theXObject)
+ {
+ }
+
+private:
+ XObject * m_xobjectPtr;
+};
+
+class SelectionEvent
+{
+public:
+ SelectionEvent(bool selection) : m_selection() {}
+ const XObjectPtr m_selection;
+};