aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2003-04-30 13:45:40 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2003-04-30 13:45:40 +0000
commit152c16a9acfdcf0eedcfb800b7aed3c57539aa5c (patch)
tree593d04b5e6e91addf98e05bc17c5523be7702cce
parentd3d40e23b32e60afbbdfa3677208c0d9722c1a38 (diff)
downloadgcc-152c16a9acfdcf0eedcfb800b7aed3c57539aa5c.zip
gcc-152c16a9acfdcf0eedcfb800b7aed3c57539aa5c.tar.gz
gcc-152c16a9acfdcf0eedcfb800b7aed3c57539aa5c.tar.bz2
decl.c (check_previous_goto_1): Adjust prototype.
* decl.c (check_previous_goto_1): Adjust prototype. (check_previous_goto): Adjust use. (check_switch_goto): Likewise. (use_label): Adjust. (check_previous_goto_1): Don't use pedwarn_with_file_and_line. (struct named_label_use_list): Use location_t datatype. From-SVN: r66290
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/decl.c26
2 files changed, 20 insertions, 15 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f255e13..d6fd395 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+2003-04-30 Garbiel Dos Reis <gcc@integrable-solutions.net>
+
+ * decl.c (check_previous_goto_1): Adjust prototype.
+ (check_previous_goto): Adjust use.
+ (check_switch_goto): Likewise.
+ (use_label): Adjust.
+ (check_previous_goto_1): Don't use pedwarn_with_file_and_line.
+ (struct named_label_use_list): Use location_t datatype.
+
2003-04-29 Mark Mitchell <mark@codesourcery.com>
PR c++/10551
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 1e157f7..2c911a5 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -112,7 +112,7 @@ static void add_decl_to_level (tree, struct cp_binding_level *);
static tree make_label_decl (tree, int);
static void use_label (tree);
static void check_previous_goto_1 (tree, struct cp_binding_level *, tree,
- const char *, int);
+ const location_t *);
static void check_previous_goto (struct named_label_use_list *);
static void check_switch_goto (struct cp_binding_level *);
static void check_previous_gotos (tree);
@@ -215,8 +215,7 @@ struct named_label_use_list GTY(())
struct cp_binding_level *binding_level;
tree names_in_scope;
tree label_decl;
- const char *filename_o_goto;
- int lineno_o_goto;
+ location_t o_goto_locus;
struct named_label_use_list *next;
};
@@ -4626,8 +4625,8 @@ use_label (tree decl)
new_ent->label_decl = decl;
new_ent->names_in_scope = current_binding_level->names;
new_ent->binding_level = current_binding_level;
- new_ent->lineno_o_goto = lineno;
- new_ent->filename_o_goto = input_filename;
+ new_ent->o_goto_locus.line = lineno;
+ new_ent->o_goto_locus.file = input_filename;
new_ent->next = named_label_uses;
named_label_uses = new_ent;
}
@@ -4726,9 +4725,7 @@ decl_jump_unsafe (tree decl)
static void
check_previous_goto_1 (tree decl,
struct cp_binding_level* level,
- tree names,
- const char* file,
- int line)
+ tree names, const location_t *locus)
{
int identified = 0;
int saw_eh = 0;
@@ -4751,8 +4748,8 @@ check_previous_goto_1 (tree decl,
else
pedwarn ("jump to case label");
- if (file)
- pedwarn_with_file_and_line (file, line, " from here");
+ if (locus)
+ pedwarn ("%H from here", locus);
identified = 1;
}
@@ -4775,8 +4772,8 @@ check_previous_goto_1 (tree decl,
else
pedwarn ("jump to case label");
- if (file)
- pedwarn_with_file_and_line (file, line, " from here");
+ if (locus)
+ pedwarn ("%H from here", locus);
identified = 1;
}
if (b->is_try_scope)
@@ -4792,14 +4789,13 @@ static void
check_previous_goto (struct named_label_use_list* use)
{
check_previous_goto_1 (use->label_decl, use->binding_level,
- use->names_in_scope, use->filename_o_goto,
- use->lineno_o_goto);
+ use->names_in_scope, &use->o_goto_locus);
}
static void
check_switch_goto (struct cp_binding_level* level)
{
- check_previous_goto_1 (NULL_TREE, level, level->names, NULL, 0);
+ check_previous_goto_1 (NULL_TREE, level, level->names, NULL);
}
/* Check that any previously seen jumps to a newly defined label DECL