This is the mail archive of the gcc-patches@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]

C++ PATCH for minor cleanup of type_has_user_provided_default_constructor


While working on something else I noticed that this function was duplicating sufficient_parms_p, and could just call it.

Tested x86_64-pc-linux-gnu, applying to trunk.
commit 4189e98a5a7c3b9b4b5e79f550327011c32449a6
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Jun 15 12:11:54 2010 -0400

    	* class.c (type_has_user_provided_default_constructor): Use
    	sufficient_parms_p.

diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 14224aa..340fe87 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -4247,7 +4247,7 @@ type_has_user_provided_constructor (tree t)
 bool
 type_has_user_provided_default_constructor (tree t)
 {
-  tree fns, args;
+  tree fns;
 
   if (!TYPE_HAS_USER_CONSTRUCTOR (t))
     return false;
@@ -4256,14 +4256,9 @@ type_has_user_provided_default_constructor (tree t)
     {
       tree fn = OVL_CURRENT (fns);
       if (TREE_CODE (fn) == FUNCTION_DECL
-	  && 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;
-	}
+	  && user_provided_p (fn)
+	  && sufficient_parms_p (FUNCTION_FIRST_USER_PARMTYPE (fn)))
+	return true;
     }
 
   return false;

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