This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/36944] [4.4 Regression]: Revision 138123 breaks C++



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]