From 61a1a73ecbc18c92bda1f240c8cd2ee4f5d2d6fe Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 3 Dec 2014 18:41:42 +0000 Subject: [PATCH] re PR c++/63558 (cannot silence "jump to case label" with fpermissive) /cp 2014-12-03 Paolo Carlini 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 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 --- gcc/cp/ChangeLog | 7 ++ gcc/cp/decl.c | 104 ++++++++++++------- gcc/testsuite/ChangeLog | 22 ++++ gcc/testsuite/g++.dg/eh/goto2.C | 7 +- gcc/testsuite/g++.dg/ext/vla14.C | 6 +- gcc/testsuite/g++.dg/gomp/block-1.C | 7 +- gcc/testsuite/g++.dg/gomp/block-2.C | 7 +- gcc/testsuite/g++.dg/gomp/block-3.C | 14 +-- gcc/testsuite/g++.dg/gomp/block-5.C | 5 +- gcc/testsuite/g++.dg/gomp/target-1.C | 10 +- gcc/testsuite/g++.dg/gomp/target-2.C | 10 +- gcc/testsuite/g++.dg/gomp/taskgroup-1.C | 10 +- gcc/testsuite/g++.dg/gomp/teams-1.C | 24 +++-- gcc/testsuite/g++.dg/init/goto2.C | 4 +- gcc/testsuite/g++.dg/init/goto3.C | 25 +++++ gcc/testsuite/g++.dg/warn/pedantic1.C | 4 +- gcc/testsuite/g++.old-deja/g++.jason/jump.C | 2 +- gcc/testsuite/g++.old-deja/g++.law/arm6.C | 2 +- gcc/testsuite/g++.old-deja/g++.other/goto1.C | 4 +- gcc/testsuite/g++.old-deja/g++.other/goto3.C | 12 +-- gcc/testsuite/g++.old-deja/g++.other/init9.C | 12 +-- 21 files changed, 196 insertions(+), 102 deletions(-) create mode 100644 gcc/testsuite/g++.dg/init/goto3.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 24fbdd56012..0e2548fbdb8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2014-12-03 Paolo Carlini + + 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 * constexpr.c (cxx_eval_builtin_function_call): Use diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 716ab5f720c..2996ee68757 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8c68f5135f4..0b4d31f0234 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,25 @@ +2014-12-03 Paolo Carlini + + 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 PR target/64019 diff --git a/gcc/testsuite/g++.dg/eh/goto2.C b/gcc/testsuite/g++.dg/eh/goto2.C index de06d50b6e3..e9f1ca515a2 100644 --- a/gcc/testsuite/g++.dg/eh/goto2.C +++ b/gcc/testsuite/g++.dg/eh/goto2.C @@ -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" } } diff --git a/gcc/testsuite/g++.dg/ext/vla14.C b/gcc/testsuite/g++.dg/ext/vla14.C index 278cb63b938..5824ab37d84 100644 --- a/gcc/testsuite/g++.dg/ext/vla14.C +++ b/gcc/testsuite/g++.dg/ext/vla14.C @@ -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" } ; } diff --git a/gcc/testsuite/g++.dg/gomp/block-1.C b/gcc/testsuite/g++.dg/gomp/block-1.C index d2b86645af8..3ec6ac8e458 100644 --- a/gcc/testsuite/g++.dg/gomp/block-1.C +++ b/gcc/testsuite/g++.dg/gomp/block-1.C @@ -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 diff --git a/gcc/testsuite/g++.dg/gomp/block-2.C b/gcc/testsuite/g++.dg/gomp/block-2.C index 17d98d845a5..7d572c17049 100644 --- a/gcc/testsuite/g++.dg/gomp/block-2.C +++ b/gcc/testsuite/g++.dg/gomp/block-2.C @@ -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 diff --git a/gcc/testsuite/g++.dg/gomp/block-3.C b/gcc/testsuite/g++.dg/gomp/block-3.C index ff281752843..4b98d1cdffc 100644 --- a/gcc/testsuite/g++.dg/gomp/block-3.C +++ b/gcc/testsuite/g++.dg/gomp/block-3.C @@ -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 } diff --git a/gcc/testsuite/g++.dg/gomp/block-5.C b/gcc/testsuite/g++.dg/gomp/block-5.C index 391f8b660a6..5023e3792ee 100644 --- a/gcc/testsuite/g++.dg/gomp/block-5.C +++ b/gcc/testsuite/g++.dg/gomp/block-5.C @@ -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" } } } diff --git a/gcc/testsuite/g++.dg/gomp/target-1.C b/gcc/testsuite/g++.dg/gomp/target-1.C index b6ed4f89cd8..ae2398804c7 100644 --- a/gcc/testsuite/g++.dg/gomp/target-1.C +++ b/gcc/testsuite/g++.dg/gomp/target-1.C @@ -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 } } } diff --git a/gcc/testsuite/g++.dg/gomp/target-2.C b/gcc/testsuite/g++.dg/gomp/target-2.C index 6a14f53cff6..6bf8b189336 100644 --- a/gcc/testsuite/g++.dg/gomp/target-2.C +++ b/gcc/testsuite/g++.dg/gomp/target-2.C @@ -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 } } } diff --git a/gcc/testsuite/g++.dg/gomp/taskgroup-1.C b/gcc/testsuite/g++.dg/gomp/taskgroup-1.C index dcab0bb6466..c31aa61583f 100644 --- a/gcc/testsuite/g++.dg/gomp/taskgroup-1.C +++ b/gcc/testsuite/g++.dg/gomp/taskgroup-1.C @@ -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 } } } diff --git a/gcc/testsuite/g++.dg/gomp/teams-1.C b/gcc/testsuite/g++.dg/gomp/teams-1.C index ce40b55ca15..86abe12b658 100644 --- a/gcc/testsuite/g++.dg/gomp/teams-1.C +++ b/gcc/testsuite/g++.dg/gomp/teams-1.C @@ -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 } diff --git a/gcc/testsuite/g++.dg/init/goto2.C b/gcc/testsuite/g++.dg/init/goto2.C index 3f4ecc04cf9..f95214f3878 100644 --- a/gcc/testsuite/g++.dg/init/goto2.C +++ b/gcc/testsuite/g++.dg/init/goto2.C @@ -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 index 00000000000..4c5ceaba3e1 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/goto3.C @@ -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; + } +} diff --git a/gcc/testsuite/g++.dg/warn/pedantic1.C b/gcc/testsuite/g++.dg/warn/pedantic1.C index 2a4d05536c5..08de9ba26f4 100644 --- a/gcc/testsuite/g++.dg/warn/pedantic1.C +++ b/gcc/testsuite/g++.dg/warn/pedantic1.C @@ -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; diff --git a/gcc/testsuite/g++.old-deja/g++.jason/jump.C b/gcc/testsuite/g++.old-deja/g++.jason/jump.C index d720a928853..31edfa6254d 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/jump.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/jump.C @@ -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) ; diff --git a/gcc/testsuite/g++.old-deja/g++.law/arm6.C b/gcc/testsuite/g++.old-deja/g++.law/arm6.C index a057b1898be..382941bca51 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/arm6.C +++ b/gcc/testsuite/g++.old-deja/g++.law/arm6.C @@ -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 ; diff --git a/gcc/testsuite/g++.old-deja/g++.other/goto1.C b/gcc/testsuite/g++.old-deja/g++.other/goto1.C index 0dcc8bc0024..9a9ba8be7d2 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/goto1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/goto1.C @@ -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 } diff --git a/gcc/testsuite/g++.old-deja/g++.other/goto3.C b/gcc/testsuite/g++.old-deja/g++.other/goto3.C index e063ad27dc7..779ada72ec7 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/goto3.C +++ b/gcc/testsuite/g++.old-deja/g++.other/goto3.C @@ -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 "" } } diff --git a/gcc/testsuite/g++.old-deja/g++.other/init9.C b/gcc/testsuite/g++.old-deja/g++.other/init9.C index 6780b5a973e..46d99028bdd 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/init9.C +++ b/gcc/testsuite/g++.old-deja/g++.other/init9.C @@ -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 void c() { - goto bar; // { dg-error "" } jump from here - std::vector x; // { dg-error "" } jump crosses initialization + goto bar; // { dg-message "" } jump from here + std::vector x; // { dg-message "" } jump crosses initialization bar: // { dg-error "" } jump to here ; } -- 2.30.2