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]

Patch to C++ dump_decl()



This patch just adds another case to dump_decl().  It makes sure
we print a sensible error message for the following nonsensical code:

	int n;
	void f() { n.~S; }

Please install if OK.

Richard



2001-01-16  Richard Sandiford  <r.sandiford@redhat.com>

	* error.c (dump_decl): Add case for BIT_NOT_EXPR.

Index: gcc/cp/error.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/error.c,v
retrieving revision 1.148
diff -c -d -p -r1.148 error.c
*** error.c	2001/01/10 15:40:58	1.148
--- gcc/cp/error.c	2001/01/16 15:32:04
*************** dump_decl (t, flags)
*** 1075,1080 ****
--- 1075,1085 ----
        dump_decl (TREE_OPERAND (t, 0), flags);
        break;
  
+     case BIT_NOT_EXPR:
+       output_add_character (scratch_buffer, '~');
+       dump_decl (TREE_OPERAND (t, 0), flags);
+       break;
+ 
      case LABEL_DECL:
        print_tree_identifier (scratch_buffer, DECL_NAME (t));
        break;


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