Commit ff60c668 by H.J. Lu Committed by H.J. Lu

re PR c++/36944 (Revision 138123 breaks constructors with default arguments)

gcc/cp/

2008-07-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/36944
	* class.c (type_has_user_provided_default_constructor): Handle
	default parameters.

gcc/testsuite/

2008-07-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/36944
	* g++.dg/other/pr36944.C: New.

From-SVN: r138194
parent 330e765e
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
......
......@@ -4107,7 +4107,7 @@ type_has_user_provided_constructor (tree t)
bool
type_has_user_provided_default_constructor (tree t)
{
tree fns;
tree fns, args;
if (!TYPE_HAS_USER_CONSTRUCTOR (t))
return false;
......@@ -4116,10 +4116,14 @@ type_has_user_provided_default_constructor (tree t)
{
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;
......
2008-07-27 H.J. Lu <hongjiu.lu@intel.com>
PR c++/36944
* g++.dg/other/pr36944.C: New.
2008-07-27 Daniel Franke <franke.daniel@gmail.com>
PR fortran/36724
......
/* { 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;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment