FreeBSD/contrib/gcc/cp/decl.c
/* Check that a single previously seen jump to a newly defined label
   is OK.  DECL is the LABEL_DECL or 0; LEVEL is the binding_level for
   the jump context; NAMES are the names in scope in LEVEL at the jump
   context; LOCUS is the source position of the jump or 0.  Returns
   true if all is well.  */
Check that a single previously seen jump to a newly defined label
is OK.  DECL is the LABEL_DECL or 0; LEVEL is the binding_level for
the jump context; NAMES are the names in scope in LEVEL at the jump
context; LOCUS is the source position of the jump or 0.  Returns
true if all is well.
Check that a single previously seen jump to a newly defined label is OK . DECL is the LABEL_DECL or 0 ; LEVEL is the binding_level for the jump context ; NAMES are the names in scope in LEVEL at the jump context ; LOCUS is the source position of the jump or 0 . Returns true if all is well .
static bool
check_previous_goto_1 (tree decl, struct cp_binding_level* level, tree names,
		       bool exited_omp, const location_t *locus)
{
  struct cp_binding_level *b;
  bool identified = false, saw_eh = false, saw_omp = false;
  if (exited_omp)
    {
      identify_goto (decl, locus);
      error ("  exits OpenMP structured block");
      identified = saw_omp = true;
    }
  for (b = current_binding_level; b ; b = b->level_chain)
    {
      tree new_decls, old_decls = (b == level ? names : NULL_TREE);
      for (new_decls = b->names; new_decls != old_decls;
	   new_decls = TREE_CHAIN (new_decls))
	{
	  int problem = decl_jump_unsafe (new_decls);
	  if (! problem)
	    continue;
	  if (!identified)
	    {
	      identify_goto (decl, locus);
	      identified = true;
	    }
	  if (problem > 1)
	    error ("  crosses initialization of %q+#D", new_decls);
	  else
	    pedwarn ("  enters scope of non-POD %q+#D", new_decls);
	}
      if (b == level)
	break;
      if ((b->kind == sk_try || b->kind == sk_catch) && !saw_eh)
	{
	  if (!identified)
	    {
	      identify_goto (decl, locus);
	      identified = true;
	    }
	  if (b->kind == sk_try)
	    error ("  enters try block");
	  else
	    error ("  enters catch block");
	  saw_eh = true;
	}
      if (b->kind == sk_omp && !saw_omp)
	{
	  if (!identified)
	    {
	      identify_goto (decl, locus);
	      identified = true;
	    }
	  error ("  enters OpenMP structured block");
	  saw_omp = true;
	}
    }
  return !identified;
}
static bool check_previous_goto_1 ( tree decl , struct cp_binding_level * level , tree names , bool exited_omp , const location_t * locus ) { struct cp_binding_level * b ; bool identified = false , saw_eh = false , saw_omp = false ; if ( exited_omp ) { identify_goto ( decl , locus ) ; error ( " " ) ; identified = saw_omp = true ; } for ( b = current_binding_level ; b ; b = b -> level_chain ) { tree new_decls , old_decls = ( b == level ? names : NULL_TREE ) ; for ( new_decls = b -> names ; new_decls != old_decls ; new_decls = TREE_CHAIN ( new_decls ) ) { int problem = decl_jump_unsafe ( new_decls ) ; if ( ! problem ) continue ; if ( ! identified ) { identify_goto ( decl , locus ) ; identified = true ; } if ( problem > 1 ) error ( " " , new_decls ) ; else pedwarn ( " " , new_decls ) ; } if ( b == level ) break ; if ( ( b -> kind == sk_try || b -> kind == sk_catch ) && ! saw_eh ) { if ( ! identified ) { identify_goto ( decl , locus ) ; identified = true ; } if ( b -> kind == sk_try ) error ( " " ) ; else error ( " " ) ; saw_eh = true ; } if ( b -> kind == sk_omp && ! saw_omp ) { if ( ! identified ) { identify_goto ( decl , locus ) ; identified = true ; } error ( " " ) ; saw_omp = true ; } } return ! identified ; }
Check that a single previously seen jump to a newly defined label
is OK.  DECL is the LABEL_DECL or 0; LEVEL is the binding_level for
the jump context; NAMES are the names in scope in LEVEL at the jump
context; LOCUS is the source position of the jump or 0.
Check that a single previously seen jump to a newly defined label is OK . DECL is the LABEL_DECL or 0 ; LEVEL is the binding_level for the jump context ; NAMES are the names in scope in LEVEL at the jump context ; LOCUS is the source position of the jump or 0 .