This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36944] [4.4 Regression]: Revision 138123 breaks C++
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jul 2008 18:05:57 -0000
- Subject: [Bug c++/36944] [4.4 Regression]: Revision 138123 breaks C++
- References: <bug-36944-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from hjl dot tools at gmail dot com 2008-07-26 18:05 -------
This works for me:
Index: class.c
===================================================================
--- class.c (revision 138172)
+++ class.c (working copy)
@@ -4107,7 +4107,7 @@ type_has_user_provided_constructor (tree
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,17 @@ type_has_user_provided_default_construct
{
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))
+ {
+ if (skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn))
+ == NULL_TREE)
+ return true;
+ 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;
Is this correct?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36944