aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2003-09-06 15:44:34 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2003-09-06 15:44:34 +0000
commitb9c87401ae95e5b970c32a854adbb154951551f3 (patch)
tree78a855038664b00d74ef9e6d943946875e5047f4 /gcc/cp/decl.c
parentd85a0aae6d490c98756dee915631a41cc3bab370 (diff)
downloadgcc-b9c87401ae95e5b970c32a854adbb154951551f3.zip
gcc-b9c87401ae95e5b970c32a854adbb154951551f3.tar.gz
gcc-b9c87401ae95e5b970c32a854adbb154951551f3.tar.bz2
re PR c++/11595 (crash on duplicate label definition)
PR c++/11595 * decl.c (define_label): Remove unreachable timevar pop. Always return the decl, even if the definition is invalid. From-SVN: r71138
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 1575ec4..c11a7c5 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4937,8 +4937,7 @@ check_goto (tree decl)
}
/* Define a label, specifying the location in the source file.
- Return the LABEL_DECL node for the label, if the definition is valid.
- Otherwise return 0. */
+ Return the LABEL_DECL node for the label. */
tree
define_label (location_t location, tree name)
@@ -4961,10 +4960,7 @@ define_label (location_t location, tree name)
pedwarn ("label named wchar_t");
if (DECL_INITIAL (decl) != NULL_TREE)
- {
- error ("duplicate label `%D'", decl);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE);
- }
+ error ("duplicate label `%D'", decl);
else
{
/* Mark label as having been defined. */
@@ -4977,9 +4973,10 @@ define_label (location_t location, tree name)
ent->binding_level = current_binding_level;
}
check_previous_gotos (decl);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
}
+
timevar_pop (TV_NAME_LOOKUP);
+ return decl;
}
struct cp_switch