[patch] Remove unused parameter from complete_type_or_diagnostic

Volker Reichelt reichelt@igpm.rwth-aachen.de
Tue Jan 25 23:06:00 GMT 2005


The function complete_type_or_diagnostic in cp/typeck.c is only
called via the macro complete_type_or_else with the third parameter
always being 0.

The following patch removes this useless last parameter of
complete_type_or_diagnostic. By renaming the function to
complete_type_or_else we get rid of the macro, too.

Bootstrapped and regtested on i686-pc-linux-gnu.

Ok for mainline?

Regards,
Volker


2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>

	* cp-tree.h (complete_type_or_else): Remove macro.
	(complete_type_or_diagnostic): Rename to complete_type_or_else
	and remove last argument.
	* typeck.c (complete_type_or_diagnostic): Rename to
	complete_type_or_else and remove last argument. Adjust comment.

===================================================================
--- cp-tree.h	10 Jan 2005 19:37:05 -0000	1.1088
+++ cp-tree.h	25 Jan 2005 16:14:28 -0000
@@ -4302,8 +4302,7 @@ extern tree condition_conversion		(tree)
 extern tree target_type				(tree);
 extern tree require_complete_type		(tree);
 extern tree complete_type			(tree);
-extern tree complete_type_or_diagnostic         (tree, tree, int);
-#define complete_type_or_else(T,V) (complete_type_or_diagnostic ((T), (V), 0))
+extern tree complete_type_or_else		(tree, tree);
 extern int type_unknown_p			(tree);
 extern tree commonparms				(tree, tree);
 extern tree original_type			(tree);
===================================================================
--- typeck.c	22 Dec 2004 18:00:39 -0000	1.606
+++ typeck.c	25 Jan 2005 16:12:26 -0000
@@ -137,12 +137,11 @@ complete_type (tree type)
 }
 
 /* Like complete_type, but issue an error if the TYPE cannot be completed.
-   VALUE is used for informative diagnostics.  DIAG_TYPE indicates the type
-   of diagnostic: 0 for an error, 1 for a warning, 2 for a pedwarn.
+   VALUE is used for informative diagnostics.
    Returns NULL_TREE if the type cannot be made complete.  */
 
 tree
-complete_type_or_diagnostic (tree type, tree value, int diag_type)
+complete_type_or_else (tree type, tree value)
 {
   type = complete_type (type);
   if (type == error_mark_node)
@@ -150,7 +149,7 @@ complete_type_or_diagnostic (tree type, 
     return NULL_TREE;
   else if (!COMPLETE_TYPE_P (type))
     {
-      cxx_incomplete_type_diagnostic (value, type, diag_type);
+      cxx_incomplete_type_diagnostic (value, type, 0);
       return NULL_TREE;
     }
   else
===================================================================




More information about the Gcc-patches mailing list