diff mbox

[C++] PR 63558

Message ID 547F2EF7.60702@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Dec. 3, 2014, 3:40 p.m. UTC
Hi,

in this bug Manuel noticed that a permerror emitted by 
check_previous_goto_1 via identify_goto is followed by an explanatory 
error instead of an inform, which then can't be suppressed with 
-fpermissive -w. When consistently adjusting the testsuite I noticed 
that check_goto too needs fixing about permerror + inform. Tested 
x86_64-linux.

Thanks,
Paolo.

///////////////////////
/cp
2014-12-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/63558
	* decl.c (identify_goto): Return a bool if diagnostic is emitted.
	(check_previous_goto_1): Consistently emit permerror + inform.
	(check_goto): Likewise.

/testsuite
2014-12-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/63558
	* g++.dg/init/goto3.C: New.
	* g++.dg/eh/goto2.C: Adjust.
	* g++.dg/ext/vla14.C: Likewise.
	* g++.dg/gomp/block-1.C: Likewise.
	* g++.dg/gomp/block-2.C: Likewise.
	* g++.dg/gomp/block-3.C: Likewise.
	* g++.dg/gomp/block-5.C: Likewise.
	* g++.dg/gomp/target-1.C: Likewise.
	* g++.dg/gomp/target-2.C: Likewise.
	* g++.dg/gomp/taskgroup-1.C: Likewise.
	* g++.dg/gomp/teams-1.C: Likewise.
	* g++.dg/init/goto2.C: Likewise.
	* g++.dg/warn/pedantic1.C: Likewise.
	* g++.old-deja/g++.jason/jump.C: Likewise.
	* g++.old-deja/g++.law/arm6.C: Likewise.
	* g++.old-deja/g++.other/goto1.C: Likewise.
	* g++.old-deja/g++.other/goto3.C: Likewise.
	* g++.old-deja/g++.other/init9.C: Likewise.

Comments

Jason Merrill Dec. 3, 2014, 5:14 p.m. UTC | #1
OK.

Jason
diff mbox

Patch

Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 218304)
+++ cp/decl.c	(working copy)
@@ -2874,15 +2874,15 @@  decl_jump_unsafe (tree decl)
 
 /* A subroutine of check_previous_goto_1 to identify a branch to the user.  */
 
-static void
+static bool
 identify_goto (tree decl, const location_t *locus)
 {
-  if (decl)
-    permerror (input_location, "jump to label %qD", decl);
-  else
-    permerror (input_location, "jump to case label");
-  if (locus)
-    permerror (*locus, "  from here");
+  bool complained = (decl
+		     ? permerror (input_location, "jump to label %qD", decl)
+		     : permerror (input_location, "jump to case label"));
+  if (complained && locus)
+    inform (*locus, "  from here");
+  return complained;
 }
 
 /* Check that a single previously seen jump to a newly defined label
@@ -2896,12 +2896,14 @@  check_previous_goto_1 (tree decl, cp_binding_level
 		       bool exited_omp, const location_t *locus)
 {
   cp_binding_level *b;
-  bool identified = false, saw_eh = false, saw_omp = false;
+  bool identified = false, complained = false;
+  bool saw_eh = false, saw_omp = false;
 
   if (exited_omp)
     {
-      identify_goto (decl, locus);
-      error ("  exits OpenMP structured block");
+      complained = identify_goto (decl, locus);
+      if (complained)
+	inform (input_location, "  exits OpenMP structured block");
       identified = saw_omp = true;
     }
 
@@ -2919,14 +2921,18 @@  check_previous_goto_1 (tree decl, cp_binding_level
 
 	  if (!identified)
 	    {
-	      identify_goto (decl, locus);
+	      complained = identify_goto (decl, locus);
 	      identified = true;
 	    }
-	  if (problem > 1)
-	    error ("  crosses initialization of %q+#D", new_decls);
-	  else
-	    permerror (input_location, "  enters scope of %q+#D which has "
-		       "non-trivial destructor", new_decls);
+	  if (complained)
+	    {
+	      if (problem > 1)
+		inform (input_location,
+			"  crosses initialization of %q+#D", new_decls);
+	      else
+		inform (input_location, "  enters scope of %q+#D which has "
+			"non-trivial destructor", new_decls);
+	    }
 	}
 
       if (b == level)
@@ -2935,13 +2941,16 @@  check_previous_goto_1 (tree decl, cp_binding_level
 	{
 	  if (!identified)
 	    {
-	      identify_goto (decl, locus);
+	      complained = identify_goto (decl, locus);
 	      identified = true;
 	    }
-	  if (b->kind == sk_try)
-	    error ("  enters try block");
-	  else
-	    error ("  enters catch block");
+	  if (complained)
+	    {
+	      if (b->kind == sk_try)
+		inform (input_location, "  enters try block");
+	      else
+		inform (input_location, "  enters catch block");
+	    }
 	  saw_eh = true;
 	}
       if (b->kind == sk_omp && !saw_omp)
@@ -2948,10 +2957,11 @@  check_previous_goto_1 (tree decl, cp_binding_level
 	{
 	  if (!identified)
 	    {
-	      identify_goto (decl, locus);
+	      complained = identify_goto (decl, locus);
 	      identified = true;
 	    }
-	  error ("  enters OpenMP structured block");
+	  if (complained)
+	    inform (input_location, "  enters OpenMP structured block");
 	  saw_omp = true;
 	}
     }
@@ -2980,7 +2990,7 @@  void
 check_goto (tree decl)
 {
   struct named_label_entry *ent, dummy;
-  bool saw_catch = false, identified = false;
+  bool saw_catch = false, identified = false, complained = false;
   tree bad;
   unsigned ix;
 
@@ -3023,8 +3033,9 @@  check_goto (tree decl)
   if (ent->in_try_scope || ent->in_catch_scope
       || ent->in_omp_scope || !vec_safe_is_empty (ent->bad_decls))
     {
-      permerror (input_location, "jump to label %q+D", decl);
-      permerror (input_location, "  from here");
+      complained = permerror (input_location, "jump to label %q+D", decl);
+      if (complained)
+	inform (input_location, "  from here");
       identified = true;
     }
 
@@ -3035,23 +3046,33 @@  check_goto (tree decl)
       if (u > 1 && DECL_ARTIFICIAL (bad))
 	{
 	  /* Can't skip init of __exception_info.  */
-	  error_at (DECL_SOURCE_LOCATION (bad), "  enters catch block");
+	  if (complained)
+	    inform (DECL_SOURCE_LOCATION (bad), "  enters catch block");
 	  saw_catch = true;
 	}
-      else if (u > 1)
-	error ("  skips initialization of %q+#D", bad);
-      else
-	permerror (input_location, "  enters scope of %q+#D which has "
-		   "non-trivial destructor", bad);
+      else if (complained)
+	{
+	  if (u > 1)
+	    inform (input_location, "  skips initialization of %q+#D", bad);
+	  else
+	    inform (input_location, "  enters scope of %q+#D which has "
+		    "non-trivial destructor", bad);
+	}
     }
 
-  if (ent->in_try_scope)
-    error ("  enters try block");
-  else if (ent->in_catch_scope && !saw_catch)
-    error ("  enters catch block");
+  if (complained)
+    {
+      if (ent->in_try_scope)
+	inform (input_location, "  enters try block");
+      else if (ent->in_catch_scope && !saw_catch)
+	inform (input_location, "  enters catch block");
+    }
 
   if (ent->in_omp_scope)
-    error ("  enters OpenMP structured block");
+    {
+      if (complained)
+	inform (input_location, "  enters OpenMP structured block");
+    }
   else if (flag_openmp)
     {
       cp_binding_level *b;
@@ -3063,11 +3084,14 @@  check_goto (tree decl)
 	    {
 	      if (!identified)
 		{
-		  permerror (input_location, "jump to label %q+D", decl);
-		  permerror (input_location, "  from here");
+		  complained = permerror (input_location,
+					  "jump to label %q+D", decl);
+		  if (complained)
+		    inform (input_location, "  from here");
 		  identified = true;
 		}
-	      error ("  exits OpenMP structured block");
+	      if (complained)
+		inform (input_location, "  exits OpenMP structured block");
 	      break;
 	    }
 	}
Index: testsuite/g++.dg/eh/goto2.C
===================================================================
--- testsuite/g++.dg/eh/goto2.C	(revision 218304)
+++ testsuite/g++.dg/eh/goto2.C	(working copy)
@@ -3,10 +3,11 @@ 
 void f()
 try
   {
-    goto l2;       // { dg-error "from here" }
+    goto l2;       // { dg-message "from here" }
   l1: ;            // { dg-error "jump to label 'l1'" }
   } catch (...)
   {
-  l2: ;            // { dg-error "jump to label 'l2'|enters catch block" }
-    goto l1;       // { dg-error "from here|enters try block" }
+  l2: ;            // { dg-error "jump to label 'l2'" }
+                   // { dg-message "enters catch block" "" { target *-*-*} 10 }
+    goto l1;       // { dg-message "from here|enters try block" }
   }
Index: testsuite/g++.dg/ext/vla14.C
===================================================================
--- testsuite/g++.dg/ext/vla14.C	(revision 218304)
+++ testsuite/g++.dg/ext/vla14.C	(working copy)
@@ -4,8 +4,8 @@ 
 void
 f (int n)
 {
-  goto label; // { dg-error "from here" }
-  int a[n]; // { dg-error "crosses initialization" }
+  goto label; // { dg-message "from here" }
+  int a[n]; // { dg-message "crosses initialization" }
 label: // { dg-error "jump to label" }
   ;
 }
@@ -16,7 +16,7 @@  g (int n)
   switch (1)
   {
   case 1:
-    int (*a)[n]; // { dg-error "crosses initialization" }
+    int (*a)[n]; // { dg-message "crosses initialization" }
   default: // { dg-error "jump to case label" }
     ;
   }
Index: testsuite/g++.dg/gomp/block-1.C
===================================================================
--- testsuite/g++.dg/gomp/block-1.C	(revision 218304)
+++ testsuite/g++.dg/gomp/block-1.C	(working copy)
@@ -4,12 +4,13 @@  void foo()
 {
   bad1:				// { dg-error "jump to label" }
   #pragma omp parallel
-    goto bad1;			// { dg-error "from here|exits OpenMP" }
+    goto bad1;			// { dg-message "from here|exits OpenMP" }
 
-  goto bad2;			// { dg-error "from here" }
+  goto bad2;			// { dg-message "from here" }
   #pragma omp parallel
     {
-      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+      bad2: ;			// { dg-error "jump to label" }
+                                // { dg-message "enters OpenMP" "" { target *-*-* } 12 }
     }
 
   #pragma omp parallel
Index: testsuite/g++.dg/gomp/block-2.C
===================================================================
--- testsuite/g++.dg/gomp/block-2.C	(revision 218304)
+++ testsuite/g++.dg/gomp/block-2.C	(working copy)
@@ -11,13 +11,14 @@  void foo()
   bad1:				// { dg-error "jump to label" }
   #pragma omp for
   for (i = 0; i < 10; ++i)
-    goto bad1;			// { dg-error "from here|exits OpenMP" }
+    goto bad1;			// { dg-message "from here|exits OpenMP" }
 
-  goto bad2;			// { dg-error "from here" }
+  goto bad2;			// { dg-message "from here" }
   #pragma omp for
   for (i = 0; i < 10; ++i)
     {
-      bad2: ;			// { dg-error "jump|enters OpenMP" }
+      bad2: ;			// { dg-error "jump" }
+                                // { dg-message "enters OpenMP" "" { target *-*-* } 20 }
     }
 
   #pragma omp for
Index: testsuite/g++.dg/gomp/block-3.C
===================================================================
--- testsuite/g++.dg/gomp/block-3.C	(revision 218304)
+++ testsuite/g++.dg/gomp/block-3.C	(working copy)
@@ -18,19 +18,21 @@  void foo()
     #pragma omp section
       { bad1: ; }		// { dg-error "jump to label" }
     #pragma omp section
-      goto bad1;		// { dg-error "from here|enters OpenMP" }
+      goto bad1;		// { dg-message "from here|enters OpenMP" }
     }
 
   #pragma omp sections
     {
-      goto bad2;		// { dg-error "from here" }
+      goto bad2;		// { dg-message "from here" }
     }
-  bad2:;			// { dg-error "jump|exits OpenMP" }
+  bad2:;			// { dg-error "jump" }
+                                // { dg-message "exits OpenMP" "" { target *-*-* } 28 }
 
-  goto bad3;			// { dg-error "from here" }
+  goto bad3;			// { dg-message "from here" }
   #pragma omp sections
     {
-      bad3: ;			// { dg-error "jump|enters OpenMP" }
+      bad3: ;			// { dg-error "jump" }
+                                // { dg-message "enters OpenMP" "" { target *-*-* } 34 }
     }
 
   #pragma omp sections
@@ -60,4 +62,4 @@  void foo()
 
 // { dg-message "error: invalid branch to/from an OpenMP structured block" "" { target *-*-* } 21 }
 // { dg-message "error: invalid branch to/from an OpenMP structured block" "" { target *-*-* } 26 }
-// { dg-message "error: invalid entry to OpenMP structured block" "" { target *-*-* } 30 }
+// { dg-message "error: invalid entry to OpenMP structured block" "" { target *-*-* } 31 }
Index: testsuite/g++.dg/gomp/block-5.C
===================================================================
--- testsuite/g++.dg/gomp/block-5.C	(revision 218304)
+++ testsuite/g++.dg/gomp/block-5.C	(working copy)
@@ -4,12 +4,13 @@  void foo()
 {
   #pragma omp master
     {
-      goto bad1;	// { dg-error "from here" }
+      goto bad1;	// { dg-message "from here" }
     }
 
   #pragma omp master
     {
-    bad1:		// { dg-error "jump|exits OpenMP" }
+    bad1:		// { dg-error "jump" }
+                        // { dg-message "exits OpenMP" "" { target *-*-* } 12 }
       return;		// { dg-error "invalid exit" }
     }
 }
Index: testsuite/g++.dg/gomp/target-1.C
===================================================================
--- testsuite/g++.dg/gomp/target-1.C	(revision 218304)
+++ testsuite/g++.dg/gomp/target-1.C	(working copy)
@@ -5,12 +5,13 @@  foo (int x)
 {
   bad1:				// { dg-error "jump to label" }
   #pragma omp target
-    goto bad1;			// { dg-error "from here|exits OpenMP" }
+    goto bad1;			// { dg-message "from here|exits OpenMP" }
 
-  goto bad2;			// { dg-error "from here" }
+  goto bad2;			// { dg-message "from here" }
   #pragma omp target
     {
-      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+      bad2: ;			// { dg-error "jump to label" }
+                                // { dg-message "enters OpenMP" "" { target *-*-* } 13 }
     }
 
   #pragma omp target
@@ -24,7 +25,8 @@  foo (int x)
   switch (x)
   {
   #pragma omp target
-    { case 0:; }		// { dg-error "jump|enters" }
+    { case 0:; }		// { dg-error "jump" }
+                                // { dg-message "enters" "" { target *-*-* } 28 }
   }
 }
 
Index: testsuite/g++.dg/gomp/target-2.C
===================================================================
--- testsuite/g++.dg/gomp/target-2.C	(revision 218304)
+++ testsuite/g++.dg/gomp/target-2.C	(working copy)
@@ -5,12 +5,13 @@  foo (int x, int y)
 {
   bad1:				// { dg-error "jump to label" }
   #pragma omp target data map(tofrom: y)
-    goto bad1;			// { dg-error "from here|exits OpenMP" }
+    goto bad1;			// { dg-message "from here|exits OpenMP" }
 
-  goto bad2;			// { dg-error "from here" }
+  goto bad2;			// { dg-message "from here" }
   #pragma omp target data map(tofrom: y)
     {
-      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+      bad2: ;			// { dg-error "jump to label" }
+                                // { dg-message "enters OpenMP" "" { target *-*-* } 13 }
     }
 
   #pragma omp target data map(tofrom: y)
@@ -24,7 +25,8 @@  foo (int x, int y)
   switch (x)
   {
   #pragma omp target data map(tofrom: y)
-    { case 0:; }		// { dg-error "jump|enters" }
+    { case 0:; }		// { dg-error "jump" }
+                                // { dg-message "enters" "" { target *-*-* } 28 }
   }
 }
 
Index: testsuite/g++.dg/gomp/taskgroup-1.C
===================================================================
--- testsuite/g++.dg/gomp/taskgroup-1.C	(revision 218304)
+++ testsuite/g++.dg/gomp/taskgroup-1.C	(working copy)
@@ -5,12 +5,13 @@  foo (int x)
 {
   bad1:				// { dg-error "jump to label" }
   #pragma omp taskgroup
-    goto bad1;			// { dg-error "from here|exits OpenMP" }
+    goto bad1;			// { dg-message "from here|exits OpenMP" }
 
-  goto bad2;			// { dg-error "from here" }
+  goto bad2;			// { dg-message "from here" }
   #pragma omp taskgroup
     {
-      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+      bad2: ;			// { dg-error "jump to label" }
+                                // { dg-message "enters OpenMP" "" { target *-*-* } 13 }
     }
 
   #pragma omp taskgroup
@@ -24,7 +25,8 @@  foo (int x)
   switch (x)
   {
   #pragma omp taskgroup
-    { case 0:; }		// { dg-error "jump|enters" }
+    { case 0:; }		// { dg-error "jump" }
+                                // { dg-message "enters" "" { target *-*-* } 28 }
   }
 }
 
Index: testsuite/g++.dg/gomp/teams-1.C
===================================================================
--- testsuite/g++.dg/gomp/teams-1.C	(revision 218304)
+++ testsuite/g++.dg/gomp/teams-1.C	(working copy)
@@ -5,12 +5,13 @@  foo (int x)
 {
   bad1:				// { dg-error "jump to label" }
   #pragma omp target teams
-    goto bad1;			// { dg-error "from here|exits OpenMP" }
+    goto bad1;			// { dg-message "from here|exits OpenMP" }
 
-  goto bad2;			// { dg-error "from here" }
+  goto bad2;			// { dg-message "from here" }
   #pragma omp target teams
     {
-      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+      bad2: ;			// { dg-error "jump to label" }
+                                // { dg-message "enters OpenMP" "" { target *-*-* } 13 }
     }
 
   #pragma omp target teams
@@ -24,7 +25,8 @@  foo (int x)
   switch (x)
   {
   #pragma omp target teams
-    { case 0:; }		// { dg-error "jump|enters" }
+    { case 0:; }		// { dg-error "jump" }
+                                // { dg-message "enters" "" { target *-*-* } 28 }
   }
 }
 
@@ -34,13 +36,14 @@  bar (int x)
   bad1:				// { dg-error "jump to label" }
   #pragma omp target
   #pragma omp teams
-    goto bad1;			// { dg-error "from here|exits OpenMP" }
+    goto bad1;			// { dg-message "from here|exits OpenMP" }
 
-  goto bad2;			// { dg-error "from here" }
+  goto bad2;			// { dg-message "from here" }
   #pragma omp target
   #pragma omp teams
     {
-      bad2: ;			// { dg-error "jump to label|enters OpenMP" }
+      bad2: ;			// { dg-error "jump to label" }
+                                // { dg-message "enters OpenMP" "" { target *-*-* } 45 }
     }
 
   #pragma omp target
@@ -56,11 +59,12 @@  bar (int x)
   {
   #pragma omp target
   #pragma omp teams
-    { case 0:; }		// { dg-error "jump|enters" }
+    { case 0:; }		// { dg-error "jump" }
+                                // { dg-message "enters" "" { target *-*-* } 62 }
   }
 }
 
 // { dg-error "invalid branch to/from an OpenMP structured block" "" { target *-*-* } 8 }
 // { dg-error "invalid entry to OpenMP structured block" "" { target *-*-* } 10 }
-// { dg-error "invalid branch to/from an OpenMP structured block" "" { target *-*-* } 37 }
-// { dg-error "invalid entry to OpenMP structured block" "" { target *-*-* } 39 }
+// { dg-error "invalid branch to/from an OpenMP structured block" "" { target *-*-* } 39 }
+// { dg-error "invalid entry to OpenMP structured block" "" { target *-*-* } 41 }
Index: testsuite/g++.dg/init/goto2.C
===================================================================
--- testsuite/g++.dg/init/goto2.C	(revision 218304)
+++ testsuite/g++.dg/init/goto2.C	(working copy)
@@ -3,8 +3,8 @@ 
 bool f();
 void g(int i)
 {
-  if (i) goto bad; // { dg-error "from" }
-  bool a = f(); // { dg-error "initialization" }
+  if (i) goto bad; // { dg-message "from" }
+  bool a = f(); // { dg-message "initialization" }
  bad: // { dg-error "jump" }
   ;
 }
Index: testsuite/g++.dg/init/goto3.C
===================================================================
--- testsuite/g++.dg/init/goto3.C	(revision 0)
+++ testsuite/g++.dg/init/goto3.C	(working copy)
@@ -0,0 +1,25 @@ 
+// PR c++/63558
+// { dg-options "-fpermissive -w" }
+
+extern int abs(int);
+static long int n_ants;
+enum enum_var_types
+ { VAR_NONE, VAR_DELTA, VAR_SWITCH };
+
+static enum enum_var_types option_var_n_ants;
+void
+adapt_parameters_next_iteration(void)
+{
+    switch(option_var_n_ants) {
+
+    case VAR_NONE: break;
+
+    case VAR_DELTA:
+        int trunc_n_ants = 0;
+        n_ants += trunc_n_ants;
+        break;
+    case VAR_SWITCH:
+        break;
+      default: break;
+    }
+}
Index: testsuite/g++.dg/warn/pedantic1.C
===================================================================
--- testsuite/g++.dg/warn/pedantic1.C	(revision 218304)
+++ testsuite/g++.dg/warn/pedantic1.C	(working copy)
@@ -2,9 +2,9 @@ 
 // { dg-options "-pedantic" }
 
 int main() {
-  goto label;   // { dg-error "" }
+  goto label;   // { dg-message "" }
   
-  int temp = 1; // { dg-error "" } 
+  int temp = 1; // { dg-message "" } 
   
   label:        // { dg-error "" } 
     return 1;
Index: testsuite/g++.old-deja/g++.jason/jump.C
===================================================================
--- testsuite/g++.old-deja/g++.jason/jump.C	(revision 218304)
+++ testsuite/g++.old-deja/g++.jason/jump.C	(working copy)
@@ -6,7 +6,7 @@  extern int a;
 int main() {
   switch (a) {
   case 1:
-    int v2 = 3;			// { dg-error "" } referenced below
+    int v2 = 3;			// { dg-message "" } referenced below
   case 2:			// { dg-error "" } jumping past initializer
     if (v2 == 7)
       ;
Index: testsuite/g++.old-deja/g++.law/arm6.C
===================================================================
--- testsuite/g++.old-deja/g++.law/arm6.C	(revision 218304)
+++ testsuite/g++.old-deja/g++.law/arm6.C	(working copy)
@@ -12,7 +12,7 @@  int main() {
 
         switch (a) {
         case 1:
-                int v2 = 3;// { dg-error "" }    crosses.*
+                int v2 = 3;// { dg-message "" }    crosses.*
         case 2:// { dg-error "" }  jump.*
                 if (v2 == 7)    // error not flagged by 2.3.1
                         ;
Index: testsuite/g++.old-deja/g++.other/goto1.C
===================================================================
--- testsuite/g++.old-deja/g++.other/goto1.C	(revision 218304)
+++ testsuite/g++.old-deja/g++.other/goto1.C	(working copy)
@@ -10,7 +10,7 @@  struct S
 void f ()
 {
   {
-    S s1; // { dg-error "" } skips initialization
+    S s1; // { dg-message "" } skips initialization
   
   t:	  // { dg-error "" } jump to label
     S s2;
@@ -17,5 +17,5 @@  void f ()
     ;
   }
 
-  goto t; // { dg-error "" } from here
+  goto t; // { dg-message "" } from here
 }
Index: testsuite/g++.old-deja/g++.other/goto3.C
===================================================================
--- testsuite/g++.old-deja/g++.other/goto3.C	(revision 218304)
+++ testsuite/g++.old-deja/g++.other/goto3.C	(working copy)
@@ -4,17 +4,17 @@ 
 
 void f ()
 {
-  goto foo1;			 // { dg-error "" } jumps
+  goto foo1;			 // { dg-message "" } jumps
   try { foo1:; } catch (...) { } // { dg-error "" } into try
-  goto foo2;			 // { dg-error "" } jumps
+  goto foo2;			 // { dg-message "" } jumps
   try { } catch (...) { foo2:; } // { dg-error "" } into catch
-  goto foo3;			 // { dg-error "" } jumps
+  goto foo3;			 // { dg-message "" } jumps
   { int i=2; foo3:; }		 // { dg-error "" } past init
 
   try { foo4:; } catch (...) { } // { dg-error "" } 
-  goto foo4;			 // { dg-error "" } 
+  goto foo4;			 // { dg-message "" } 
   try { } catch (...) { foo5:; } // { dg-error "" } 
-  goto foo5;			 // { dg-error "" } 
+  goto foo5;			 // { dg-message "" } 
   { int i=2; foo6:; }		 // { dg-error "" } 
-  goto foo6;			 // { dg-error "" } 
+  goto foo6;			 // { dg-message "" } 
 }
Index: testsuite/g++.old-deja/g++.other/init9.C
===================================================================
--- testsuite/g++.old-deja/g++.other/init9.C	(revision 218304)
+++ testsuite/g++.old-deja/g++.other/init9.C	(working copy)
@@ -13,8 +13,8 @@  struct A {
 };
 
 void a() {
-  goto bar; // { dg-error "" } jump from here
-  A x; // { dg-error "" } jump crosses initialization
+  goto bar; // { dg-message "" } jump from here
+  A x; // { dg-message "" } jump crosses initialization
  bar: // { dg-error "" } jump to here
   ;
 }
@@ -24,8 +24,8 @@  struct X {
 };
 
 void b() {
-  goto bar; // { dg-error "" } jump from here
-  X x; // { dg-error "" } jump crosses initialization
+  goto bar; // { dg-message "" } jump from here
+  X x; // { dg-message "" } jump crosses initialization
  bar: // { dg-error "" } jump to here
   ;
 }
@@ -33,8 +33,8 @@  void b() {
 #include <vector>
 
 void c() {
-  goto bar; // { dg-error "" } jump from here
-  std::vector<int> x; // { dg-error "" } jump crosses initialization
+  goto bar; // { dg-message "" } jump from here
+  std::vector<int> x; // { dg-message "" } jump crosses initialization
  bar: // { dg-error "" } jump to here
   ;
 }