This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11595] [3.3/3.4 Regresion] crash on duplicate label definition
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Sep 2003 14:26:04 -0000
- Subject: [Bug c++/11595] [3.3/3.4 Regresion] crash on duplicate label definition
- References: <20030719213224.11595.zack@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11595
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #4504|Easily fixed, I'd say |This should fix it
description| |
------- Additional Comments From steven at gcc dot gnu dot org 2003-09-06 14:26 -------
(From update of attachment 4504)
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1121
diff -c -p -3 -r1.1121 decl.c
*** decl.c 4 Sep 2003 03:18:02 -0000 1.1121
--- decl.c 6 Sep 2003 14:12:36 -0000
*************** check_goto (tree decl)
*** 4937,4944 ****
}
/* 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. */
tree
define_label (location_t location, tree name)
--- 4937,4943 ----
}
/* Define a label, specifying the location in the source file.
! Return the LABEL_DECL node for the label. */
tree
define_label (location_t location, tree name)
*************** define_label (location_t location, tree
*** 4961,4970 ****
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);
! }
else
{
/* Mark label as having been defined. */
--- 4960,4966 ----
pedwarn ("label named wchar_t");
if (DECL_INITIAL (decl) != NULL_TREE)
! error ("duplicate label `%D'", decl);
else
{
/* Mark label as having been defined. */
*************** define_label (location_t location, tree
*** 4977,4985 ****
ent->binding_level = current_binding_level;
}
check_previous_gotos (decl);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
}
! timevar_pop (TV_NAME_LOOKUP);
}
struct cp_switch
--- 4973,4981 ----
ent->binding_level = current_binding_level;
}
check_previous_gotos (decl);
}
!
! POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
}
struct cp_switch