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]

[lto] Use num_parm_types and nth_parm_type in grokdeclarator.


Hi,

Tested on x86_64-pc-linux-gnu.  Committed to the LTO branch as
obvious.

Kazu Hirata

2006-07-26  Kazu Hirata  <kazu@codesourcery.com>

	* decl.c (grokdeclarator): Use num_parm_types and
	nth_parm_type.

Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 115758)
+++ cp/decl.c	(working copy)
@@ -7608,7 +7608,8 @@ grokdeclarator (const cp_declarator *dec
 	    if (inner_declarator
 		&& inner_declarator->kind == cdk_id
 		&& inner_declarator->u.id.sfk == sfk_destructor
-		&& arg_types != void_list_node)
+		&& !(num_parm_types (arg_types) == 1
+		     && nth_parm_type (arg_types, 0) == void_type_node))
 	      {
 		error ("destructors may not have parameters");
 		arg_types = void_list_node;


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