diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/call.c | 12 | ||||
-rw-r--r-- | gcc/cp/class.c | 12 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 97 | ||||
-rw-r--r-- | gcc/cp/decl.c | 12 | ||||
-rw-r--r-- | gcc/cp/except.c | 4 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 4 | ||||
-rw-r--r-- | gcc/cp/method.c | 2 | ||||
-rw-r--r-- | gcc/cp/name-lookup.h | 20 | ||||
-rw-r--r-- | gcc/cp/parser.c | 28 | ||||
-rw-r--r-- | gcc/cp/parser.h | 36 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 8 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 4 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 2 |
14 files changed, 123 insertions, 124 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2c2cb6d5535..e313e641061 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> + + * call.c, class.c, cp-tree.h, decl.c, except.c, mangle.c, + method.c, name-lookup.h, parser.c, parser.h, rtti.c, + semantics.c, typeck2.c: Remove useless typedefs. + 2015-08-18 Jason Merrill <jason@redhat.com> DR 1155 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 909ac990189..8d4a9e23a0a 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see /* The various kinds of conversion. */ -typedef enum conversion_kind { +enum conversion_kind { ck_identity, ck_lvalue, ck_qual, @@ -62,12 +62,12 @@ typedef enum conversion_kind { ck_list, ck_aggr, ck_rvalue -} conversion_kind; +}; /* The rank of the conversion. Order of the enumerals matters; better conversions should come earlier in the list. */ -typedef enum conversion_rank { +enum conversion_rank { cr_identity, cr_exact, cr_promotion, @@ -76,13 +76,12 @@ typedef enum conversion_rank { cr_user, cr_ellipsis, cr_bad -} conversion_rank; +}; /* An implicit conversion sequence, in the sense of [over.best.ics]. The first conversion to be performed is at the end of the chain. That conversion is always a cr_identity conversion. */ -typedef struct conversion conversion; struct conversion { /* The kind of conversion represented by this step. */ conversion_kind kind; @@ -407,9 +406,8 @@ build_call_a (tree function, int n, tree *argarray) /* New overloading code. */ -typedef struct z_candidate z_candidate; +struct z_candidate; -typedef struct candidate_warning candidate_warning; struct candidate_warning { z_candidate *loser; candidate_warning *next; diff --git a/gcc/cp/class.c b/gcc/cp/class.c index bf7b5c4bab6..f8ba795ddcb 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -71,7 +71,7 @@ typedef struct class_stack_node { size_t hidden; }* class_stack_node_t; -typedef struct vtbl_init_data_s +struct vtbl_init_data { /* The base for which we're building initializers. */ tree binfo; @@ -100,7 +100,7 @@ typedef struct vtbl_init_data_s /* True when adding vcall offset entries to the vtable. False when merely computing the indices. */ bool generate_vcall_entries; -} vtbl_init_data; +}; /* The type of a function passed to walk_subobject_offsets. */ typedef int (*subobject_offset_fn) (tree, tree, splay_tree); @@ -2377,7 +2377,7 @@ base_derived_from (tree derived, tree base) return false; } -typedef struct find_final_overrider_data_s { +struct find_final_overrider_data { /* The function for which we are trying to find a final overrider. */ tree fn; /* The base class in which the function was declared. */ @@ -2386,7 +2386,7 @@ typedef struct find_final_overrider_data_s { tree candidates; /* Path to most derived. */ vec<tree> path; -} find_final_overrider_data; +}; /* Add the overrider along the current path to FFOD->CANDIDATES. Returns true if an overrider was found; false otherwise. */ @@ -8556,7 +8556,7 @@ binfo_ctor_vtable (tree binfo) } /* Data for secondary VTT initialization. */ -typedef struct secondary_vptr_vtt_init_data_s +struct secondary_vptr_vtt_init_data { /* Is this the primary VTT? */ bool top_level_p; @@ -8569,7 +8569,7 @@ typedef struct secondary_vptr_vtt_init_data_s /* The type being constructed by this secondary VTT. */ tree type_being_constructed; -} secondary_vptr_vtt_init_data; +}; /* Recursively build the VTT-initializer for BINFO (which is in the hierarchy dominated by T). INITS points to the end of the initializer diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index ab6b3ec6206..7cf5278f04a 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -283,14 +283,13 @@ identifier_p (tree t) #define LANG_IDENTIFIER_CAST(NODE) \ ((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE)) -struct GTY(()) template_parm_index_s { +struct GTY(()) template_parm_index { struct tree_common common; int index; int level; int orig_level; tree decl; }; -typedef struct template_parm_index_s template_parm_index; struct GTY(()) ptrmem_cst { struct tree_common common; @@ -417,7 +416,7 @@ struct GTY(()) tree_baselink { /* The different kinds of ids that we encounter. */ -typedef enum cp_id_kind +enum cp_id_kind { /* Not an id at all. */ CP_ID_KIND_NONE, @@ -429,12 +428,12 @@ typedef enum cp_id_kind CP_ID_KIND_TEMPLATE_ID, /* A qualified-id. */ CP_ID_KIND_QUALIFIED -} cp_id_kind; +}; /* The various kinds of C++0x warnings we encounter. */ -typedef enum cpp0x_warn_str +enum cpp0x_warn_str { /* extended initializer lists */ CPP0X_INITIALIZER_LISTS, @@ -466,11 +465,11 @@ typedef enum cpp0x_warn_str CPP0X_ATTRIBUTES, /* ref-qualified member functions */ CPP0X_REF_QUALIFIER -} cpp0x_warn_str; +}; /* The various kinds of operation used by composite_pointer_type. */ -typedef enum composite_pointer_operation +enum composite_pointer_operation { /* comparison */ CPO_COMPARISON, @@ -478,27 +477,27 @@ typedef enum composite_pointer_operation CPO_CONVERSION, /* conditional expression */ CPO_CONDITIONAL_EXPR -} composite_pointer_operation; +}; /* Possible cases of expression list used by build_x_compound_expr_from_list. */ -typedef enum expr_list_kind { +enum expr_list_kind { ELK_INIT, /* initializer */ ELK_MEM_INIT, /* member initializer */ ELK_FUNC_CAST /* functional cast */ -} expr_list_kind; +}; /* Possible cases of implicit bad rhs conversions. */ -typedef enum impl_conv_rhs { +enum impl_conv_rhs { ICR_DEFAULT_ARGUMENT, /* default argument */ ICR_CONVERTING, /* converting */ ICR_INIT, /* initialization */ ICR_ARGPASS, /* argument passing */ ICR_RETURN, /* return */ ICR_ASSIGN /* assignment */ -} impl_conv_rhs; +}; /* Possible cases of implicit or explicit bad conversions to void. */ -typedef enum impl_conv_void { +enum impl_conv_void { ICV_CAST, /* (explicit) conversion to void */ ICV_SECOND_OF_COND, /* second operand of conditional expression */ ICV_THIRD_OF_COND, /* third operand of conditional expression */ @@ -506,11 +505,11 @@ typedef enum impl_conv_void { ICV_LEFT_OF_COMMA, /* left operand of comma operator */ ICV_STATEMENT, /* statement */ ICV_THIRD_IN_FOR /* for increment expression */ -} impl_conv_void; +}; /* Possible invalid uses of an abstract class that might not have a specific associated declaration. */ -typedef enum abstract_class_use { +enum GTY(()) abstract_class_use { ACU_UNKNOWN, /* unknown or decl provided */ ACU_CAST, /* cast to abstract class */ ACU_NEW, /* new-expression of abstract class */ @@ -519,7 +518,7 @@ typedef enum abstract_class_use { ACU_ARRAY, /* array of abstract class */ ACU_RETURN, /* return type of abstract class */ ACU_PARM /* parameter type of abstract class */ -} abstract_class_use; +}; /* Macros for access to language-specific slots in an identifier. */ @@ -642,7 +641,7 @@ struct GTY (()) tree_argument_pack_select { /* The different kinds of traits that we encounter. */ -typedef enum cp_trait_kind +enum cp_trait_kind { CPTK_BASES, CPTK_DIRECT_BASES, @@ -671,7 +670,7 @@ typedef enum cp_trait_kind CPTK_IS_TRIVIALLY_COPYABLE, CPTK_IS_UNION, CPTK_UNDERLYING_TYPE -} cp_trait_kind; +}; /* The types that we are processing. */ #define TRAIT_EXPR_TYPE1(NODE) \ @@ -991,7 +990,7 @@ union GTY((desc ("cp_tree_node_structure (&%h)"), chain_next ("(union lang_tree_node *) c_tree_chain_next (&%h.generic)"))) lang_tree_node { union tree_node GTY ((tag ("TS_CP_GENERIC"), desc ("tree_node_structure (&%h)"))) generic; - struct template_parm_index_s GTY ((tag ("TS_CP_TPI"))) tpi; + struct template_parm_index GTY ((tag ("TS_CP_TPI"))) tpi; struct ptrmem_cst GTY ((tag ("TS_CP_PTRMEM"))) ptrmem; struct tree_overload GTY ((tag ("TS_CP_OVERLOAD"))) overload; struct tree_baselink GTY ((tag ("TS_CP_BASELINK"))) baselink; @@ -1584,10 +1583,10 @@ enum languages { lang_c, lang_cplusplus, lang_java }; #define CLASSTYPE_VISIBILITY_SPECIFIED(TYPE) \ DECL_VISIBILITY_SPECIFIED (TYPE_MAIN_DECL (TYPE)) -typedef struct GTY (()) tree_pair_s { +struct GTY (()) tree_pair_s { tree purpose; tree value; -} tree_pair_s; +}; typedef tree_pair_s *tree_pair_p; /* This is a few header flags for 'struct lang_type'. Actually, @@ -3333,11 +3332,11 @@ extern void decl_shadowed_for_var_insert (tree, tree); /* Abstract iterators for AGGR_INIT_EXPRs. */ /* Structure containing iterator state. */ -typedef struct aggr_init_expr_arg_iterator_d { +struct aggr_init_expr_arg_iterator { tree t; /* the aggr_init_expr */ int n; /* argument count */ int i; /* next argument index */ -} aggr_init_expr_arg_iterator; +}; /* Initialize the abstract argument list iterator object ITER with the arguments from AGGR_INIT_EXPR node EXP. */ @@ -4502,7 +4501,7 @@ enum cp_lvalue_kind_flags { typedef int cp_lvalue_kind; /* Various kinds of template specialization, instantiation, etc. */ -typedef enum tmpl_spec_kind { +enum tmpl_spec_kind { tsk_none, /* Not a template at all. */ tsk_invalid_member_spec, /* An explicit member template specialization, but the enclosing @@ -4517,22 +4516,22 @@ typedef enum tmpl_spec_kind { tsk_template, /* A template declaration. */ tsk_expl_spec, /* An explicit specialization. */ tsk_expl_inst /* An explicit instantiation. */ -} tmpl_spec_kind; +}; /* The various kinds of access. BINFO_ACCESS depends on these being two bit quantities. The numerical values are important; they are used to initialize RTTI data structures, so changing them changes the ABI. */ -typedef enum access_kind { +enum access_kind { ak_none = 0, /* Inaccessible. */ ak_public = 1, /* Accessible, as a `public' thing. */ ak_protected = 2, /* Accessible, as a `protected' thing. */ ak_private = 3 /* Accessible, as a `private' thing. */ -} access_kind; +}; /* The various kinds of special functions. If you add to this list, you should update special_function_p as well. */ -typedef enum special_function_kind { +enum special_function_kind { sfk_none = 0, /* Not a special function. This enumeral must have value zero; see special_function_p. */ @@ -4549,7 +4548,7 @@ typedef enum special_function_kind { destroyed. */ sfk_conversion, /* A conversion operator. */ sfk_inheriting_constructor /* An inheriting constructor */ -} special_function_kind; +}; /* The various kinds of linkage. From [basic.link], @@ -4568,18 +4567,18 @@ typedef enum special_function_kind { -- When a name has no linkage, the entity it denotes cannot be referred to by names from other scopes. */ -typedef enum linkage_kind { +enum linkage_kind { lk_none, /* No linkage. */ lk_internal, /* Internal linkage. */ lk_external /* External linkage. */ -} linkage_kind; +}; -typedef enum duration_kind { +enum duration_kind { dk_static, dk_thread, dk_auto, dk_dynamic -} duration_kind; +}; /* Bitmask flags to control type substitution. */ enum tsubst_flags { @@ -4625,15 +4624,15 @@ enum base_access_flags { typedef int base_access; /* The various kinds of access check during parsing. */ -typedef enum deferring_kind { +enum deferring_kind { dk_no_deferred = 0, /* Check access immediately */ dk_deferred = 1, /* Deferred check */ dk_no_check = 2 /* No access check */ -} deferring_kind; +}; /* The kind of base we can find, looking in a class hierarchy. Values <0 indicate we failed. */ -typedef enum base_kind { +enum base_kind { bk_inaccessible = -3, /* The base is inaccessible */ bk_ambig = -2, /* The base is ambiguous */ bk_not_base = -1, /* It is not a base */ @@ -4642,7 +4641,7 @@ typedef enum base_kind { bk_via_virtual = 2 /* It is a proper base, but via a virtual path. This might not be the canonical binfo. */ -} base_kind; +}; /* Node for "pointer to (virtual) function". This may be distinct from ptr_type_node so gdb can distinguish them. */ @@ -4684,11 +4683,11 @@ struct cp_unevaluated fn_type_unification. Their meanings are described with the documentation for fn_type_unification. */ -typedef enum unification_kind_t { +enum unification_kind_t { DEDUCE_CALL, DEDUCE_CONV, DEDUCE_EXACT -} unification_kind_t; +}; // An RAII class used to create a new pointer map for local // specializations. When the stack goes out of scope, the @@ -5121,7 +5120,7 @@ enum cp_ref_qualifier { /* A storage class. */ -typedef enum cp_storage_class { +enum cp_storage_class { /* sc_none must be zero so that zeroing a cp_decl_specifier_seq sets the storage_class field to sc_none. */ sc_none = 0, @@ -5130,13 +5129,13 @@ typedef enum cp_storage_class { sc_static, sc_extern, sc_mutable -} cp_storage_class; +}; /* An individual decl-specifier. This is used to index the array of locations for the declspecs in struct cp_decl_specifier_seq below. */ -typedef enum cp_decl_spec { +enum cp_decl_spec { ds_first, ds_signed = ds_first, ds_unsigned, @@ -5162,11 +5161,11 @@ typedef enum cp_decl_spec { ds_long_long, ds_concept, ds_last /* This enumerator must always be the last one. */ -} cp_decl_spec; +}; /* A decl-specifier-seq. */ -typedef struct cp_decl_specifier_seq { +struct cp_decl_specifier_seq { /* An array of locations for the declaration sepecifiers, indexed by enum cp_decl_spec_word. */ source_location locations[ds_last]; @@ -5210,11 +5209,11 @@ typedef struct cp_decl_specifier_seq { BOOL_BITFIELD gnu_thread_keyword_p : 1; /* True iff the type is a decltype. */ BOOL_BITFIELD decltype_p : 1; -} cp_decl_specifier_seq; +}; /* The various kinds of declarators. */ -typedef enum cp_declarator_kind { +enum cp_declarator_kind { cdk_id, cdk_function, cdk_array, @@ -5222,7 +5221,7 @@ typedef enum cp_declarator_kind { cdk_reference, cdk_ptrmem, cdk_error -} cp_declarator_kind; +}; /* A declarator. */ @@ -6096,7 +6095,7 @@ extern int shared_member_p (tree); /* The representation of a deferred access check. */ -typedef struct GTY(()) deferred_access_check { +struct GTY(()) deferred_access_check { /* The base class in which the declaration is referenced. */ tree binfo; /* The declaration whose access must be checked. */ @@ -6105,7 +6104,7 @@ typedef struct GTY(()) deferred_access_check { tree diag_decl; /* The location of this access. */ location_t loc; -} deferred_access_check; +}; /* in semantics.c */ extern void push_deferring_access_checks (deferring_kind); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index e8ed472293b..5c75972136a 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -254,10 +254,10 @@ enum deprecated_states deprecated_state = DEPRECATED_NORMAL; /* A list of VAR_DECLs whose type was incomplete at the time the variable was declared. */ -typedef struct GTY(()) incomplete_var_d { +struct GTY(()) incomplete_var { tree decl; tree incomplete_type; -} incomplete_var; +}; static GTY(()) vec<incomplete_var, va_gc> *incomplete_vars; @@ -3827,7 +3827,7 @@ record_unknown_type (tree type, const char* name) /* A string for which we should create an IDENTIFIER_NODE at startup. */ -typedef struct predefined_identifier +struct predefined_identifier { /* The name of the identifier. */ const char *const name; @@ -3835,7 +3835,7 @@ typedef struct predefined_identifier tree *const node; /* Nonzero if this is the name of a constructor or destructor. */ const int ctor_or_dtor_p; -} predefined_identifier; +}; /* Create all the predefined identifiers. */ @@ -5369,11 +5369,11 @@ check_for_uninitialized_const_var (tree decl) /* Structure holding the current initializer being processed by reshape_init. CUR is a pointer to the current element being processed, END is a pointer after the last element present in the initializer. */ -typedef struct reshape_iterator_t +struct reshape_iter { constructor_elt *cur; constructor_elt *end; -} reshape_iter; +}; static tree reshape_init_r (tree, reshape_iter *, bool, tsubst_flags_t); diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 4f06f52d1da..d2d1531e4c2 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -1186,10 +1186,10 @@ check_noexcept_r (tree *tp, int * /*walk_subtrees*/, void * /*data*/) /* If a function that causes a noexcept-expression to be false isn't defined yet, remember it and check it for TREE_NOTHROW again at EOF. */ -typedef struct GTY(()) pending_noexcept { +struct GTY(()) pending_noexcept { tree fn; location_t loc; -} pending_noexcept; +}; static GTY(()) vec<pending_noexcept, va_gc> *pending_noexcept_checks; /* FN is a FUNCTION_DECL that caused a noexcept-expr to be false. Warn if diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 4518f20cc8e..342cb93e68b 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -95,7 +95,7 @@ along with GCC; see the file COPYING3. If not see && (PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE)))))) /* Things we only need one of. This module is not reentrant. */ -typedef struct GTY(()) globals { +struct GTY(()) globals { /* An array of the current substitution candidates, in the order we've seen them. */ vec<tree, va_gc> *substitutions; @@ -109,7 +109,7 @@ typedef struct GTY(()) globals { /* True if the mangling will be different in a future version of the ABI. */ bool need_abi_warning; -} globals; +}; static GTY (()) globals G; diff --git a/gcc/cp/method.c b/gcc/cp/method.c index fdc76043e93..b3e247c5b1f 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -56,8 +56,6 @@ enum mangling_flags mf_use_underscores_around_value = 2 }; -typedef enum mangling_flags mangling_flags; - static void do_build_copy_assign (tree); static void do_build_copy_constructor (tree); static tree make_alias_for_thunk (tree); diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index 4d941fec746..4b9419282d1 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -77,13 +77,13 @@ struct GTY(()) cxx_binding { /* Datatype used to temporarily save C++ bindings (for implicit instantiations purposes and like). Implemented in decl.c. */ -typedef struct GTY(()) cxx_saved_binding { +struct GTY(()) cxx_saved_binding { /* The name of the current binding. */ tree identifier; /* The binding we're saving. */ cxx_binding *binding; tree real_type_value; -} cxx_saved_binding; +}; extern tree identifier_type_value (tree); @@ -94,7 +94,7 @@ extern tree constructor_name (tree); extern bool constructor_name_p (tree, tree); /* The kinds of scopes we recognize. */ -typedef enum scope_kind { +enum scope_kind { sk_block = 0, /* An ordinary block scope. This enumerator must have the value zero because "cp_binding_level" is initialized by using "memset" to set the @@ -121,10 +121,10 @@ typedef enum scope_kind { explicit specialization is introduced by "template <>", this scope is always empty. */ sk_omp /* An OpenMP structured block. */ -} scope_kind; +}; /* The scope where the class/struct/union/enum tag applies. */ -typedef enum tag_scope { +enum tag_scope { ts_current = 0, /* Current scope only. This is for the class-key identifier; case mentioned in [basic.lookup.elab]/2, @@ -138,21 +138,21 @@ typedef enum tag_scope { according to [namespace.memdef]/3 and [class.friend]/9. */ ts_lambda = 3 /* Declaring a lambda closure. */ -} tag_scope; +}; -typedef struct GTY(()) cp_class_binding { +struct GTY(()) cp_class_binding { cxx_binding *base; /* The bound name. */ tree identifier; -} cp_class_binding; +}; -typedef struct GTY(()) cp_label_binding { +struct GTY(()) cp_label_binding { /* The bound LABEL_DECL. */ tree label; /* The previous IDENTIFIER_LABEL_VALUE. */ tree prev_value; -} cp_label_binding; +}; /* For each binding contour we allocate a binding_level structure diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index a0b249bbf5b..67fbcda4426 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -62,7 +62,7 @@ static cp_token eof_token = }; /* The various kinds of non integral constant we encounter. */ -typedef enum non_integral_constant { +enum non_integral_constant { NIC_NONE, /* floating-point literal */ NIC_FLOAT, @@ -118,10 +118,10 @@ typedef enum non_integral_constant { NIC_CONSTRUCTOR, /* a transaction expression */ NIC_TRANSACTION -} non_integral_constant; +}; /* The various kinds of errors about name-lookup failing. */ -typedef enum name_lookup_error { +enum name_lookup_error { /* NULL */ NLE_NULL, /* is not a type */ @@ -130,10 +130,10 @@ typedef enum name_lookup_error { NLE_CXX98, /* is not a class, namespace, or enumeration */ NLE_NOT_CXX98 -} name_lookup_error; +}; /* The various kinds of required token */ -typedef enum required_token { +enum required_token { RT_NONE, RT_SEMICOLON, /* ';' */ RT_OPEN_PAREN, /* '(' */ @@ -186,7 +186,7 @@ typedef enum required_token { RT_TRANSACTION_ATOMIC, /* __transaction_atomic */ RT_TRANSACTION_RELAXED, /* __transaction_relaxed */ RT_TRANSACTION_CANCEL /* __transaction_cancel */ -} required_token; +}; /* Prototypes. */ @@ -1733,7 +1733,7 @@ typedef int cp_parser_flags; /* The different kinds of declarators we want to parse. */ -typedef enum cp_parser_declarator_kind +enum cp_parser_declarator_kind { /* We want an abstract declarator. */ CP_PARSER_DECLARATOR_ABSTRACT, @@ -1741,7 +1741,7 @@ typedef enum cp_parser_declarator_kind CP_PARSER_DECLARATOR_NAMED, /* We don't mind, but the name must be an unqualified-id. */ CP_PARSER_DECLARATOR_EITHER -} cp_parser_declarator_kind; +}; /* The precedence values used to parse binary expressions. The minimum value of PREC must be 1, because zero is reserved to quickly discriminate @@ -1767,7 +1767,7 @@ enum cp_parser_prec /* A mapping from a token type to a corresponding tree node type, with a precedence value. */ -typedef struct cp_parser_binary_operations_map_node +struct cp_parser_binary_operations_map_node { /* The token type. */ enum cpp_ttype token_type; @@ -1775,9 +1775,9 @@ typedef struct cp_parser_binary_operations_map_node enum tree_code tree_type; /* The precedence of this operator. */ enum cp_parser_prec prec; -} cp_parser_binary_operations_map_node; +}; -typedef struct cp_parser_expression_stack_entry +struct cp_parser_expression_stack_entry { /* Left hand side of the binary operation we are currently parsing. */ @@ -1791,7 +1791,7 @@ typedef struct cp_parser_expression_stack_entry enum cp_parser_prec prec; /* Location of the binary operation we are parsing. */ location_t loc; -} cp_parser_expression_stack_entry; +}; /* The stack for storing partial expressions. We only need NUM_PREC_VALUES entries because precedence levels on the stack are monotonically @@ -9003,11 +9003,11 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword) use the count for function and namespace scopes as well. */ static GTY(()) tree lambda_scope; static GTY(()) int lambda_count; -typedef struct GTY(()) tree_int +struct GTY(()) tree_int { tree t; int i; -} tree_int; +}; static GTY(()) vec<tree_int, va_gc> *lambda_scope_stack; static void diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h index c7091c8e8e0..760467c2eb0 100644 --- a/gcc/cp/parser.h +++ b/gcc/cp/parser.h @@ -39,7 +39,7 @@ struct GTY(()) tree_check { /* A C++ token. */ -typedef struct GTY (()) cp_token { +struct GTY (()) cp_token { /* The kind of token. */ ENUM_BITFIELD (cpp_ttype) type : 8; /* If this token is a keyword, this value indicates which keyword. @@ -68,7 +68,7 @@ typedef struct GTY (()) cp_token { /* Use for all other tokens. */ tree GTY((tag ("0"))) value; } GTY((desc ("(%1.type == CPP_TEMPLATE_ID) || (%1.type == CPP_NESTED_NAME_SPECIFIER)"))) u; -} cp_token; +}; /* We use a stack of token pointer for saving token sets. */ @@ -79,7 +79,7 @@ typedef struct cp_token *cp_token_position; it to the parser. Tokens are never added to the cp_lexer after it is created. */ -typedef struct GTY (()) cp_lexer { +struct GTY (()) cp_lexer { /* The memory allocated for the buffer. NULL if this lexer does not own the token buffer. */ vec<cp_token, va_gc> *buffer; @@ -107,7 +107,7 @@ typedef struct GTY (()) cp_lexer { /* True if we're in the context of parsing a pragma, and should not increment past the end-of-line marker. */ bool in_pragma; -} cp_lexer; +}; /* cp_token_cache is a range of tokens. There is no need to represent @@ -116,17 +116,17 @@ typedef struct GTY (()) cp_lexer { a cp_token_cache, since everything in here is referenced through a lexer. */ -typedef struct GTY(()) cp_token_cache { +struct GTY(()) cp_token_cache { /* The beginning of the token range. */ cp_token * GTY((skip)) first; /* Points immediately after the last token in the range. */ cp_token * GTY ((skip)) last; -} cp_token_cache; +}; typedef cp_token_cache *cp_token_cache_ptr; -struct cp_token_ident_d +struct cp_token_ident { unsigned int ident_len; const char *ident_str; @@ -136,22 +136,20 @@ struct cp_token_ident_d const char *after_str; }; -typedef struct cp_token_ident_d cp_token_ident; - /* An entry in a queue of function arguments that require post-processing. */ -typedef struct GTY(()) cp_default_arg_entry_d { +struct GTY(()) cp_default_arg_entry { /* The current_class_type when we parsed this arg. */ tree class_type; /* The function decl itself. */ tree decl; -} cp_default_arg_entry; +}; /* An entry in a stack for member functions defined within their classes. */ -typedef struct GTY(()) cp_unparsed_functions_entry_d { +struct GTY(()) cp_unparsed_functions_entry { /* Functions with default arguments that require post-processing. Functions appear in this list in declaration order. */ vec<cp_default_arg_entry, va_gc> *funs_with_default_args; @@ -167,12 +165,12 @@ typedef struct GTY(()) cp_unparsed_functions_entry_d { /* Nested classes go in this vector, so that we can do some final processing after parsing any NSDMIs. */ vec<tree, va_gc> *classes; -} cp_unparsed_functions_entry; +}; /* The status of a tentative parse. */ -typedef enum cp_parser_status_kind +enum cp_parser_status_kind { /* No errors have occurred. */ CP_PARSER_STATUS_KIND_NO_ERROR, @@ -181,11 +179,11 @@ typedef enum cp_parser_status_kind /* We are committed to this tentative parse, whether or not an error has occurred. */ CP_PARSER_STATUS_KIND_COMMITTED -} cp_parser_status_kind; +}; /* Context that is saved and restored when parsing tentatively. */ -typedef struct GTY (()) cp_parser_context { +struct GTY (()) cp_parser_context { /* If this is a tentative parsing context, the status of the tentative parse. */ enum cp_parser_status_kind status; @@ -197,7 +195,7 @@ typedef struct GTY (()) cp_parser_context { /* The next parsing context in the stack. */ struct cp_parser_context *next; -} cp_parser_context; +}; /* Control structure for #pragma omp declare simd parsing. */ @@ -210,7 +208,7 @@ struct cp_omp_declare_simd_data { /* The cp_parser structure represents the C++ parser. */ -typedef struct GTY(()) cp_parser { +struct GTY(()) cp_parser { /* The lexer from which we are obtaining tokens. */ cp_lexer *lexer; @@ -406,7 +404,7 @@ typedef struct GTY(()) cp_parser { context e.g., because they could never be deduced. */ int prevent_constrained_type_specifiers; -} cp_parser; +}; /* In parser.c */ extern void debug (cp_token &ref); diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index ed81322a577..e4b6e00e3b8 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see translation, when we are emitting the type info objects. */ /* Auxiliary data we hold for each type_info derived object we need. */ -typedef struct GTY (()) tinfo_s { +struct GTY (()) tinfo_s { tree type; /* The RECORD_TYPE for this type_info object */ tree vtable; /* The VAR_DECL of the vtable. Only filled at end of @@ -72,10 +72,10 @@ typedef struct GTY (()) tinfo_s { tree name; /* IDENTIFIER_NODE for the ABI specified name of the type_info derived type. */ -} tinfo_s; +}; -typedef enum tinfo_kind +enum tinfo_kind { TK_TYPE_INFO_TYPE, /* abi::__type_info_pseudo */ TK_BASE_TYPE, /* abi::__base_class_type_info */ @@ -89,7 +89,7 @@ typedef enum tinfo_kind TK_SI_CLASS_TYPE, /* abi::__si_class_type_info */ TK_FIXED /* end of fixed descriptors. */ /* ... abi::__vmi_type_info<I> */ -} tinfo_kind; +}; /* Helper macro to get maximum scalar-width of pointer or of the 'long'-type. This of interest for llp64 targets. */ diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 7bbae06f717..2a69ab0863f 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -115,7 +115,7 @@ static tree capture_decltype (tree); In case of parsing error, we simply call `pop_deferring_access_checks' without `perform_deferred_access_checks'. */ -typedef struct GTY(()) deferred_access { +struct GTY(()) deferred_access { /* A vector representing name-lookups for which we have deferred checking access controls. We cannot check the accessibility of names used in a decl-specifier-seq until we know what is being @@ -134,7 +134,7 @@ typedef struct GTY(()) deferred_access { /* The current mode of access checks. */ enum deferring_kind deferring_access_checks_kind; -} deferred_access; +}; /* Data for deferred access checking. */ static GTY(()) vec<deferred_access, va_gc> *deferred_access_stack; diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 8a3a53720a4..1d106c74995 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -145,7 +145,7 @@ struct GTY((chain_next ("%h.next"), for_user)) pending_abstract_type { tree type; /* Kind of use in an unnamed declarator. */ - abstract_class_use use; + enum abstract_class_use use; /* Position of the declaration. This is only needed for IDENTIFIER_NODEs, because DECLs already carry locus information. */ |