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: Fix PR/7566


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)
  	{


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