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]

C++ PATCH: PR 13714


This patch improves the error message emitted by the invalid code in
PR 13714.

Commited as obvious to 3.4 and mainline.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2004-02-05  Mark Mitchell  <mark@codesourcery.com>

	PR c++/13714
	* typeck.c (lookup_destructor): Tweak error message.

Index: typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.519.2.5
diff -c -5 -p -r1.519.2.5 typeck.c
*** typeck.c	5 Feb 2004 05:20:28 -0000	1.519.2.5
--- typeck.c	5 Feb 2004 19:43:16 -0000
*************** lookup_destructor (tree object, tree sco
*** 1799,1810 ****
  	     scope, dtor_type);
        return error_mark_node;
      }
    if (!same_type_p (dtor_type, TYPE_MAIN_VARIANT (object_type)))
      {
!       error ("destructor name `%T' does not match type `%T' of expression",
! 	     dtor_type, object_type);
        return error_mark_node;
      }
    if (!TYPE_HAS_DESTRUCTOR (object_type))
      return build (PSEUDO_DTOR_EXPR, void_type_node, object, scope,
  		  dtor_type);
--- 1799,1810 ----
  	     scope, dtor_type);
        return error_mark_node;
      }
    if (!same_type_p (dtor_type, TYPE_MAIN_VARIANT (object_type)))
      {
!       error ("the type being destroyed is '%T', but the destructor refers to `%T'",
! 	     TYPE_MAIN_VARIANT (object_type), dtor_type);
        return error_mark_node;
      }
    if (!TYPE_HAS_DESTRUCTOR (object_type))
      return build (PSEUDO_DTOR_EXPR, void_type_node, object, scope,
  		  dtor_type);


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