public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ Patch] PR 33493
@ 2007-09-26 14:39 Paolo Carlini
  2007-09-27  7:27 ` Gabriel Dos Reis
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Carlini @ 2007-09-26 14:39 UTC (permalink / raw)
  To: gcc-patches; +Cc: gdr

[-- Attachment #1: Type: text/plain, Size: 122 bytes --]

Hi,

another small diagnostic problem, usual approach... Tested x86_64-linux.

Ok for mainline?

Paolo.

////////////////

[-- Attachment #2: CL_33493 --]
[-- Type: text/plain, Size: 388 bytes --]

/cp
2007-09-26  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33493
	* error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
	* cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
	spaces in the formatting.
	* cxx-pretty-print.h (pp_cxx_delete_expression): Declare.

/testsuite
2007-09-26  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33493
	* g++.dg/template/error31.C: New.

[-- Attachment #3: patch_33493 --]
[-- Type: text/plain, Size: 2952 bytes --]

Index: testsuite/g++.dg/template/error31.C
===================================================================
*** testsuite/g++.dg/template/error31.C	(revision 0)
--- testsuite/g++.dg/template/error31.C	(revision 0)
***************
*** 0 ****
--- 1,3 ----
+ // PR c++/33493
+ 
+ template<int> void foo() { delete 0 ? 1 : 0; } // { dg-error "delete 0" }
Index: cp/error.c
===================================================================
*** cp/error.c	(revision 128735)
--- cp/error.c	(working copy)
*************** dump_expr (tree t, int flags)
*** 2066,2071 ****
--- 2047,2057 ----
        pp_cxx_va_arg_expression (cxx_pp, t);
        break;
  
+     case DELETE_EXPR:
+     case VEC_DELETE_EXPR:
+       pp_cxx_delete_expression (cxx_pp, t);
+       break;
+ 
        /*  This list is incomplete, but should suffice for now.
  	  It is very important that `sorry' does not call
  	  `report_error_function'.  That could cause an infinite loop.  */
Index: cp/cxx-pretty-print.c
===================================================================
*** cp/cxx-pretty-print.c	(revision 128735)
--- cp/cxx-pretty-print.c	(working copy)
*************** pp_cxx_new_expression (cxx_pretty_printe
*** 662,668 ****
        ::(opt) delete cast-expression
        ::(opt) delete [ ] cast-expression   */
  
! static void
  pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
  {
    enum tree_code code = TREE_CODE (t);
--- 662,668 ----
        ::(opt) delete cast-expression
        ::(opt) delete [ ] cast-expression   */
  
! void
  pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
  {
    enum tree_code code = TREE_CODE (t);
*************** pp_cxx_delete_expression (cxx_pretty_pri
*** 673,682 ****
        if (DELETE_EXPR_USE_GLOBAL (t))
  	pp_cxx_colon_colon (pp);
        pp_cxx_identifier (pp, "delete");
!       if (code == VEC_DELETE_EXPR)
  	{
  	  pp_left_bracket (pp);
  	  pp_right_bracket (pp);
  	}
        pp_c_cast_expression (pp_c_base (pp), TREE_OPERAND (t, 0));
        break;
--- 673,685 ----
        if (DELETE_EXPR_USE_GLOBAL (t))
  	pp_cxx_colon_colon (pp);
        pp_cxx_identifier (pp, "delete");
!       pp_space (pp);
!       if (code == VEC_DELETE_EXPR
! 	  || DELETE_EXPR_USE_VEC (t))
  	{
  	  pp_left_bracket (pp);
  	  pp_right_bracket (pp);
+ 	  pp_space (pp);
  	}
        pp_c_cast_expression (pp_c_base (pp), TREE_OPERAND (t, 0));
        break;
Index: cp/cxx-pretty-print.h
===================================================================
*** cp/cxx-pretty-print.h	(revision 128735)
--- cp/cxx-pretty-print.h	(working copy)
*************** void pp_cxx_canonical_template_parameter
*** 72,76 ****
--- 72,77 ----
  void pp_cxx_trait_expression (cxx_pretty_printer *, tree);
  void pp_cxx_typeid_expression (cxx_pretty_printer *, tree);
  void pp_cxx_va_arg_expression (cxx_pretty_printer *, tree);
+ void pp_cxx_delete_expression (cxx_pretty_printer *, tree);
  
  #endif /* GCC_CXX_PRETTY_PRINT_H */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [C++ Patch] PR 33493
  2007-09-26 14:39 [C++ Patch] PR 33493 Paolo Carlini
@ 2007-09-27  7:27 ` Gabriel Dos Reis
  2007-09-27 11:48   ` Paolo Carlini
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriel Dos Reis @ 2007-09-27  7:27 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: gcc-patches

Paolo Carlini <pcarlini@suse.de> writes:

| Hi,
| 
| another small diagnostic problem, usual approach... Tested x86_64-linux.
| 
| Ok for mainline?

OK.  Thanks!

-- Gaby

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [C++ Patch] PR 33493
  2007-09-27  7:27 ` Gabriel Dos Reis
@ 2007-09-27 11:48   ` Paolo Carlini
  2007-09-27 12:42     ` Gabriel Dos Reis
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Carlini @ 2007-09-27 11:48 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: gcc-patches, Douglas Gregor

Gabriel Dos Reis wrote:

>Paolo Carlini <pcarlini@suse.de> writes:
>
>| Hi,
>| 
>| another small diagnostic problem, usual approach... Tested x86_64-linux.
>| 
>| Ok for mainline?
>
>OK.  Thanks!
>  
>
Thanks a lot Gaby. Can I apply also the fix for c++/33118?

  http://gcc.gnu.org/ml/gcc-patches/2007-09/msg01832.html

Paolo.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [C++ Patch] PR 33493
  2007-09-27 11:48   ` Paolo Carlini
@ 2007-09-27 12:42     ` Gabriel Dos Reis
  2007-09-28 16:04       ` Paolo Carlini
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriel Dos Reis @ 2007-09-27 12:42 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: gcc-patches, Douglas Gregor

On Thu, 27 Sep 2007, Paolo Carlini wrote:

| Gabriel Dos Reis wrote:
| 
| >Paolo Carlini <pcarlini@suse.de> writes:
| >
| > | Hi,
| > | 
| > | another small diagnostic problem, usual approach... Tested x86_64-linux.
| > | 
| > | Ok for mainline?
| >
| >OK.  Thanks!
| >  
| >
| Thanks a lot Gaby. Can I apply also the fix for c++/33118?
| 
|  http://gcc.gnu.org/ml/gcc-patches/2007-09/msg01832.html

It is OK if Doug Gregor says the formatting code look OK.

-- Gaby

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [C++ Patch] PR 33493
  2007-09-27 12:42     ` Gabriel Dos Reis
@ 2007-09-28 16:04       ` Paolo Carlini
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Carlini @ 2007-09-28 16:04 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: gcc-patches, Douglas Gregor

Gabriel Dos Reis wrote:

>| Thanks a lot Gaby. Can I apply also the fix for c++/33118?
>| 
>|  http://gcc.gnu.org/ml/gcc-patches/2007-09/msg01832.html
>
>It is OK if Doug Gregor says the formatting code look OK.
>  
>
Ok, I'm going ahead, Doug checked the patch off-line...

Thanks again,
Paolo.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-28 15:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-26 14:39 [C++ Patch] PR 33493 Paolo Carlini
2007-09-27  7:27 ` Gabriel Dos Reis
2007-09-27 11:48   ` Paolo Carlini
2007-09-27 12:42     ` Gabriel Dos Reis
2007-09-28 16:04       ` Paolo Carlini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).