diff options
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 1820460..f7e46a7 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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; |