From 90ecaf87ff7b69272f0d5a1dd8cbe3a4ec7a9fd8 Mon Sep 17 00:00:00 2001 From: Rodrigo Rivas Costa Date: Tue, 26 Oct 2010 04:56:45 +0000 Subject: Implement opaque-enum-specifiers for C++0x. gcc/ * tree.h (ENUM_IS_OPAQUE): New. * dwarf2out.c (gen_enumeration_type_die): Use ENUM_IS_OPAQUE. gcc/cp/ * cp-tree.h (SET_OPAQUE_ENUM_P): New. (OPAQUE_ENUM_P): New. (ENUM_FIXED_UNDERLYING_TYPE_P): New. (start_enum): Update prototype. (finish_enum_value_list): New prototype. * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if "enum class" is used in an elaborated-type-specifier. (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers. * decl.c (copy_type_enum): New. (finish_enum_value_list): New, with code from finish_enum. (finish_enum): A lot of code removed. Added a gcc_assert. (start_enum): Add parameters enumtype and is_new. Rewrite to work with opaque-enum-specifiers. * pt.c (maybe_process_partial_specialization): Allow for template specialization of enumerations, with a pedwarn. (lookup_template_class): Update call to start_enum. Call to SET_OPAQUE_ENUM_P. (tsubst_enum): Call to begin_scope, finish_scope and finish_enum_value_list. From-SVN: r165935 --- gcc/dwarf2out.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 33a7b56..bf248dc 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -18312,9 +18312,13 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die) scope_die_for (type, context_die), type); equate_type_number_to_die (type, type_die); add_name_attribute (type_die, type_tag (type)); - if ((dwarf_version >= 4 || !dwarf_strict) - && ENUM_IS_SCOPED (type)) - add_AT_flag (type_die, DW_AT_enum_class, 1); + if (dwarf_version >= 4 || !dwarf_strict) + { + if (ENUM_IS_SCOPED (type)) + add_AT_flag (type_die, DW_AT_enum_class, 1); + if (ENUM_IS_OPAQUE (type)) + add_AT_flag (type_die, DW_AT_declaration, 1); + } } else if (! TYPE_SIZE (type)) return type_die; -- cgit v1.1