C++ PATCH: Fix PR/7566

Gabriel Dos Reis gdr@nerim.net
Wed Aug 14 10:57:00 GMT 2002


This one-liner fixes PR/7566 where warning_with_decl() was being misused.
Applied to mainline.

This is a regression from GCC-2.95.x series.  Mark, may I apply it to branch?

I discourage any use of {error, warning, pedwarn}_with_decl in any future
codes. 

-- Gaby
2002-08-14  Gabriel Dos Reis  <gdr@nerim.net>

	Fix PR/7566
	* c-semantics.c (genrtl_case_label): Don't (mis)use
	warning_with_decl. 

Index: c-semantics.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-semantics.c,v
retrieving revision 1.43
diff -p -r1.43 c-semantics.c
*** c-semantics.c	8 May 2002 09:17:16 -0000	1.43
--- c-semantics.c	14 Aug 2002 17:49:41 -0000
*************** genrtl_case_label (case_label)
*** 673,680 ****
    if (cleanup)
      {
        static int explained = 0;
!       warning_with_decl (TREE_PURPOSE (cleanup), 
! 			 "destructor needed for `%#D'");
        warning ("where case label appears here");
        if (!explained)
  	{
--- 673,679 ----
    if (cleanup)
      {
        static int explained = 0;
!       warning ("destructor needed for `%#D'", (TREE_PURPOSE (cleanup)));
        warning ("where case label appears here");
        if (!explained)
  	{



More information about the Gcc-patches mailing list