re PR c++/63558 (cannot silence "jump to case label" with fpermissive)
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 3 Dec 2014 18:41:42 +0000 (18:41 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 3 Dec 2014 18:41:42 +0000 (18:41 +0000)
/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.

From-SVN: r218328

21 files changed:
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/eh/goto2.C
gcc/testsuite/g++.dg/ext/vla14.C
gcc/testsuite/g++.dg/gomp/block-1.C
gcc/testsuite/g++.dg/gomp/block-2.C
gcc/testsuite/g++.dg/gomp/block-3.C
gcc/testsuite/g++.dg/gomp/block-5.C
gcc/testsuite/g++.dg/gomp/target-1.C
gcc/testsuite/g++.dg/gomp/target-2.C
gcc/testsuite/g++.dg/gomp/taskgroup-1.C
gcc/testsuite/g++.dg/gomp/teams-1.C
gcc/testsuite/g++.dg/init/goto2.C
gcc/testsuite/g++.dg/init/goto3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/pedantic1.C
gcc/testsuite/g++.old-deja/g++.jason/jump.C
gcc/testsuite/g++.old-deja/g++.law/arm6.C
gcc/testsuite/g++.old-deja/g++.other/goto1.C
gcc/testsuite/g++.old-deja/g++.other/goto3.C
gcc/testsuite/g++.old-deja/g++.other/init9.C

index 24fbdd56012709342d8d6047d22aae419336b9f6..0e2548fbdb8822d4b1b9077d975289337b763b69 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2014-12-03  Richard Biener  <rguenther@suse.de>
 
        * constexpr.c (cxx_eval_builtin_function_call): Use
index 716ab5f720c2aa6a2737f58b532b414f7a68d1b7..2996ee68757c1ff4f95ea42bee1dd559e5d3f985 100644 (file)
@@ -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* level, tree names,
                       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* level, tree names,
 
          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,23 +2941,27 @@ check_previous_goto_1 (tree decl, cp_binding_level* level, tree names,
        {
          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)
        {
          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 8c68f5135f44b6e04920e330d12b1f9c37d2c7a9..0b4d31f0234d0b1dcb244aedacaef30efa244da6 100644 (file)
@@ -1,3 +1,25 @@
+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.
+
 2014-12-03  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        PR target/64019
index de06d50b6e33b5a6145dc02d9c2df4ac58d5add4..e9f1ca515a21feb942143e166f9e018024695718 100644 (file)
@@ -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 278cb63b938599f19405af2a733b3c4fe0171f55..5824ab37d84d0557f2fa0e11f7347223d2d30c1e 100644 (file)
@@ -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 d2b86645af8d66eac5214602585cedce9d2c0db2..3ec6ac8e45868b886818d7f5196658048e1e1fdb 100644 (file)
@@ -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 17d98d845a567142024e1b35bd522ea41971a4e8..7d572c1704943a27fc3ac28011dbd1d4ac919ced 100644 (file)
@@ -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 ff281752843c89c68936edf7768aedcc4b3a1e8b..4b98d1cdffcc7e9addf71736b65e8179c26765b8 100644 (file)
@@ -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 391f8b660a60d8a3e490bd7b84ea29247739ce2a..5023e3792ee9ff6c664a4d88e2fec821f620fdd6 100644 (file)
@@ -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 b6ed4f89cd8cebf50f82cd0b1d522b1fef83fd6f..ae2398804c7b8f828cd278fa8d99ea9a63231ace 100644 (file)
@@ -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 6a14f53cff61061f66f5ecd43f7d1f899f5c8c34..6bf8b1893362a2e3641aa7542eb7dc909502f5d8 100644 (file)
@@ -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 dcab0bb646699c8c842d2880afc974142e3a7be1..c31aa61583ff2ff36b78d2189cb0af9e2b0a9657 100644 (file)
@@ -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 ce40b55ca15d8f4f5c64fac60aba9188a64a3396..86abe12b658dc2b7c3ac1118e3ebf4fb4684cc40 100644 (file)
@@ -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 3f4ecc04cf9a65c650fbaaa7765e13a025f3b688..f95214f387847d36102cbe1750e8f7884d0c40dc 100644 (file)
@@ -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" }
   ;
 }
diff --git a/gcc/testsuite/g++.dg/init/goto3.C b/gcc/testsuite/g++.dg/init/goto3.C
new file mode 100644 (file)
index 0000000..4c5ceab
--- /dev/null
@@ -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 2a4d05536c50126200f2e5c4448ca3eb5b0fd151..08de9ba26f4792b3be406fe44083cb9877a83bd4 100644 (file)
@@ -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 d720a9288539a0a860e700287767500739c9eaaf..31edfa6254daf66ca0660820795e6aaa13c4924c 100644 (file)
@@ -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 a057b1898bea16a27350c47995d358acaf119a6b..382941bca518df94f80639cb98ef769a36b98845 100644 (file)
@@ -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 0dcc8bc00240960cb950f70dff40f915e1347e00..9a9ba8be7d234275e977f04871b4e6a8725fadba 100644 (file)
@@ -10,12 +10,12 @@ struct S
 void f ()
 {
   {
-    S s1; // { dg-error "" } skips initialization
+    S s1; // { dg-message "" } skips initialization
   
   t:     // { dg-error "" } jump to label
     S s2;
     ;
   }
 
-  goto t; // { dg-error "" } from here
+  goto t; // { dg-message "" } from here
 }
index e063ad27dc7a59be4f496edc8b110656d9b6f16e..779ada72ec7e00bb4a405c0a2cb57655afd6fb64 100644 (file)
@@ -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 6780b5a973ead456d4f6bb727d5705167389446c..46d99028bdd61e2edcef0a82e79e8255fc33241e 100644 (file)
@@ -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
   ;
 }