Blame SOURCES/gcc32-c++-pr7566.patch

4ac4fd
2002-08-14  Gabriel Dos Reis  <gdr@nerim.net>
4ac4fd
4ac4fd
	Fix PR/7566
4ac4fd
	* c-semantics.c (genrtl_case_label): Don't (mis)use
4ac4fd
	warning_with_decl.
4ac4fd
4ac4fd
2005-01-03  Jakub Jelinek  <jakub@redhat.com>
4ac4fd
4ac4fd
	* g++.dg/parse/jumptocaselab1.C: New test.
4ac4fd
4ac4fd
--- gcc/c-semantics.c.jj	2003-01-17 18:31:04.000000000 +0100
4ac4fd
+++ gcc/c-semantics.c	2005-01-03 10:19:51.912155689 +0100
4ac4fd
@@ -673,8 +673,7 @@ genrtl_case_label (case_label)
4ac4fd
   if (cleanup)
4ac4fd
     {
4ac4fd
       static int explained = 0;
4ac4fd
-      warning_with_decl (TREE_PURPOSE (cleanup), 
4ac4fd
-			 "destructor needed for `%#D'");
4ac4fd
+      warning ("destructor needed for `%#D'", TREE_PURPOSE (cleanup));
4ac4fd
       warning ("where case label appears here");
4ac4fd
       if (!explained)
4ac4fd
 	{
4ac4fd
--- gcc/testsuite/g++.dg/parse/jumptocaselab1.C.jj	2005-01-03 10:23:45.286072690 +0100
4ac4fd
+++ gcc/testsuite/g++.dg/parse/jumptocaselab1.C	2005-01-03 10:26:29.216516818 +0100
4ac4fd
@@ -0,0 +1,19 @@
4ac4fd
+// PR c++/7566
4ac4fd
+// { dg-do compile }
4ac4fd
+
4ac4fd
+struct bar { bar (); ~bar ();};
4ac4fd
+
4ac4fd
+void foo (int c)
4ac4fd
+{
4ac4fd
+  switch (c)
4ac4fd
+    {
4ac4fd
+    case 0:
4ac4fd
+    case 1:
4ac4fd
+      bar x;	// { dg-error "crosses initialization" }
4ac4fd
+      break;
4ac4fd
+    default:	// { dg-error "jump to case label" }
4ac4fd
+      break;
4ac4fd
+    }
4ac4fd
+}
4ac4fd
+
4ac4fd
+// { dg-warning "destructor needed|where case label|enclose actions" "" { target *-*-* } 14 }