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]

[patch][c++/PR 32251]


This patch corrects the problem reported by this PR. On pass 2 (pass==1), t is not checked against being NULL before it is used. With this patch, the correct diagnostic is generated:

32251.C: In function ‘void foo()’:
32251.C:9: error: no suitable ‘operator delete’ for ‘A’

Tested with no regressions in the testsuite.

Dave

2007-07-06  Dave Brolley  <brolley@redhat.com>

	* call.c (build_op_delete_call): Ensure t is not NULL_TREE on pass 1.

Index: gcc/cp/call.c
===================================================================
--- gcc/cp/call.c	(revision 126323)
+++ gcc/cp/call.c	(working copy)
@@ -4154,6 +4154,7 @@
 	  /* On the second pass, the second argument must be
 	     "size_t".  */
 	  else if (pass == 1
+		   && t
 		   && same_type_p (TREE_VALUE (t), size_type_node)
 		   && TREE_CHAIN (t) == void_list_node)
 	    break;

Attachment: 32251.C
Description: application/unknown-content-type-c_auto_file


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