aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorRodrigo Rivas Costa <rodrigorivascosta@gmail.com>2010-10-26 04:56:45 +0000
committerJason Merrill <jason@gcc.gnu.org>2010-10-26 00:56:45 -0400
commit90ecaf87ff7b69272f0d5a1dd8cbe3a4ec7a9fd8 (patch)
tree1bab3384ca044b2ac3dc7a0b9b2dbbbc8399e741 /gcc/cp/cp-tree.h
parentf5c88dbfe7040583158ad45e4ef2801401a2732d (diff)
downloadgcc-90ecaf87ff7b69272f0d5a1dd8cbe3a4ec7a9fd8.zip
gcc-90ecaf87ff7b69272f0d5a1dd8cbe3a4ec7a9fd8.tar.gz
gcc-90ecaf87ff7b69272f0d5a1dd8cbe3a4ec7a9fd8.tar.bz2
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
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 626e452..da839ec 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3101,6 +3101,16 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define SET_SCOPED_ENUM_P(TYPE, VAL) \
(ENUM_IS_SCOPED (TYPE) = (VAL))
+#define SET_OPAQUE_ENUM_P(TYPE, VAL) \
+ (ENUM_IS_OPAQUE (TYPE) = (VAL))
+
+#define OPAQUE_ENUM_P(TYPE) \
+ (TREE_CODE (TYPE) == ENUMERAL_TYPE && ENUM_IS_OPAQUE (TYPE))
+
+/* Determines whether an ENUMERAL_TYPE has an explicit
+ underlying type. */
+#define ENUM_FIXED_UNDERLYING_TYPE_P(NODE) (TYPE_LANG_FLAG_3 (NODE))
+
/* Returns the underlying type of the given enumeration type. The
underlying type is determined in different ways, depending on the
properties of the enum:
@@ -4785,7 +4795,8 @@ extern bool grok_op_properties (tree, bool);
extern tree xref_tag (enum tag_types, tree, tag_scope, bool);
extern tree xref_tag_from_type (tree, tree, tag_scope);
extern bool xref_basetypes (tree, tree);
-extern tree start_enum (tree, tree, bool);
+extern tree start_enum (tree, tree, tree, bool, bool *);
+extern void finish_enum_value_list (tree);
extern void finish_enum (tree);
extern void build_enumerator (tree, tree, tree, location_t);
extern tree lookup_enumerator (tree, tree);