diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-07 16:12:09 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-07 16:12:09 +0000 |
commit | cbdababb9b72a255d4f9d336ad7b14647747a36b (patch) | |
tree | ba8a4e18517bf42370b70903afcb2f8ee1cd056c /gcc/cp/decl.c | |
parent | 1557756e1e4954779caa11f9106651487b328ee2 (diff) | |
download | gcc-cbdababb9b72a255d4f9d336ad7b14647747a36b.tar.gz |
* cp-tree.h (build_enumerator): Add new location_t parameter.
(build_lang_decl_loc): New function.
* decl.c (build_enumerator): New parameter loc. Use it when calling
build_decl. Replace build_lang_decl with build_lang_decl_loc.
* pt.c (tsubst_enum): Adjust call to build_enumerator.
* parser.c (cp_parser_enumerator_definition): Ditto.
* lex.c (build_lang_decl_loc): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163959 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 409836c76f3..ad4a0973d9d 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11627,10 +11627,11 @@ finish_enum (tree enumtype) /* Build and install a CONST_DECL for an enumeration constant of the enumeration type ENUMTYPE whose NAME and VALUE (if any) are provided. + LOC is the location of NAME. Assignment of sequential values by default is handled here. */ void -build_enumerator (tree name, tree value, tree enumtype) +build_enumerator (tree name, tree value, tree enumtype, location_t loc) { tree decl; tree context; @@ -11745,12 +11746,12 @@ build_enumerator (tree name, tree value, tree enumtype) if (context && context == current_class_type) /* This enum declaration is local to the class. We need the full lang_decl so that we can record DECL_CLASS_CONTEXT, for example. */ - decl = build_lang_decl (CONST_DECL, name, type); + decl = build_lang_decl_loc (loc, CONST_DECL, name, type); else /* It's a global enum, or it's local to a function. (Note local to - a function could mean local to a class method. */ - decl = build_decl (input_location, CONST_DECL, name, type); - + a function could mean local to a class method. */ + decl = build_decl (loc, CONST_DECL, name, type); + DECL_CONTEXT (decl) = FROB_CONTEXT (context); TREE_CONSTANT (decl) = 1; TREE_READONLY (decl) = 1; |