diff options
author | dgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-26 22:33:10 +0000 |
---|---|---|
committer | dgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-26 22:33:10 +0000 |
commit | 3f00a6c0b1538c8bdb329694ec8ca610a2139d9b (patch) | |
tree | 21bef2d4fb6823e27ad009498c7d32454463f706 /gcc/dbxout.c | |
parent | f14bc73f9c4e628773d1e4dd6b879fd54370e60c (diff) | |
download | gcc-3f00a6c0b1538c8bdb329694ec8ca610a2139d9b.tar.gz |
2008-08-26 Douglas Gregor <doug.gregor@gmail.com>
* c-common.c (do_switch_warnings): Look through the CONST_DECLs in
the enumerators of an ENUMERAL_TYPE.
* dbxout.c (dbxout_type): Ditto.
2008-08-26 Douglas Gregor <doug.gregor@gmail.com>
* typeck.c (type_after_usual_arithmetic_conversions): Don't do the
usual arithmetic conversions on scoped enumeration types.
(common_type): Ditto.
(default_conversion): Don't perform integral promotions on scoped
enumeration types.
(build_array_ref): Scoped enumeration types can't be used as
subscripts.
* decl.c (start_enum): If building a C++0x scoped enumeration,
enter its scope. If provided with an underlying type, check that
underlying type and set up the enumeration type accordingly.
(finish_enum): Only compute an underlying type if the underlying
type isn't already fixed, and only convert the enumerator values
now if we've just computed the underlying type. Finish the scope
of C++0x scoped enumerations.
(build_enumerator): For enumerations with a fixed underlying type,
check the enumerator values when the enumerator is defined.
(lookup_enumerator): New.
* call.c (standard_conversion): Don't allow assignment from
integers to scoped enumeration types, even with -fpermissive.
Don't convert from scoped enumerations to bool or any arithmetic
types.
(build_conditional_expr): Don't per the usual arithmetic
conversions for scoped enumeration types.
(convert_like_real): Check complain to see if we should
produce warnings.
* error.c (class_key_or_enum_as_string): Print scoped enums.
* cp-tree.h (MAYBE_CLASS_TYPE_P): Check CLASS_TYPE_P, not
TYPE_LANG_FLAG_5.
(INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P): New.
(SCOPED_ENUM_P): New.
(UNSCOPED_ENUM_P): New.
(SET_SCOPED_ENUM_P): New.
(ENUM_UNDERLYING_TYPE): New.
* pt.c (lookup_template_class): Update the instantiation of enum
types to deal with C++0x scoped enumerations and underlying
types.
* name-lookup.c (begin_scope): Deal with scoped enumeration
scopes.
(lookup_qualified_name): Deal with lookup into enumeration types.
* name-lookup.h (enum scope_kind): Add sk_scoped_enum.
* parser.c (cp_parser_class_or_namespace_name): Rename to...
(cp_parser_qualifying_entity): ... this. Also, in C++0x mode,
parse a type-name that can be an enumeration type.
(cp_parser_nested_name_specifier_opt): Update with C++0x grammar.
(cp_parser_elaborated_type_specifier): Parse the
optional `struct' or `class' following enum (in C++0x).
(cp_parser_enum_specifier): Parse C++0x scoped enumerations and
enum-base clauses.
2008-08-26 Douglas Gregor <doug.gregor@gmail.com>
* g++.dg/cpp0x/scoped_enum_examples.C: New.
* g++.dg/cpp0x/scoped_enum.C: New.
* g++.dg/cpp0x/scoped_enum_98.C: New.
* g++.dg/cpp0x/enum_base_warn.C: New.
* g++.dg/cpp0x/enum_base.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139611 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dbxout.c')
-rw-r--r-- | gcc/dbxout.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 95058753075..2843f9cca59 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -2174,16 +2174,21 @@ dbxout_type (tree type, int full) stabstr_C ('e'); for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem)) { + tree value = TREE_VALUE (tem); + stabstr_I (TREE_PURPOSE (tem)); stabstr_C (':'); - if (TREE_INT_CST_HIGH (TREE_VALUE (tem)) == 0) - stabstr_D (TREE_INT_CST_LOW (TREE_VALUE (tem))); - else if (TREE_INT_CST_HIGH (TREE_VALUE (tem)) == -1 - && (HOST_WIDE_INT) TREE_INT_CST_LOW (TREE_VALUE (tem)) < 0) - stabstr_D (TREE_INT_CST_LOW (TREE_VALUE (tem))); + if (TREE_CODE (value) == CONST_DECL) + value = DECL_INITIAL (value); + + if (TREE_INT_CST_HIGH (value) == 0) + stabstr_D (TREE_INT_CST_LOW (value)); + else if (TREE_INT_CST_HIGH (value) == -1 + && (HOST_WIDE_INT) TREE_INT_CST_LOW (value) < 0) + stabstr_D (TREE_INT_CST_LOW (value)); else - stabstr_O (TREE_VALUE (tem)); + stabstr_O (value); stabstr_C (','); if (TREE_CHAIN (tem) != 0) |