https://gcc.gnu.org/g:752db3d0c4b7f211ab9a967f4f8be6f7dace169d
commit r17-1005-g752db3d0c4b7f211ab9a967f4f8be6f7dace169d Author: Dhruv Chawla <[email protected]> Date: Wed May 13 10:59:08 2026 +0000 cp: Fix typos in various files Signed-off-by: Dhruv Chawla <[email protected]> gcc/cp/ChangeLog: * call.cc (involves_qualification_conversion_p): Fix typos. (build_user_type_conversion_1): Likewise. (complain_about_access): Likewise. (maybe_warn_class_memaccess): Likewise. * class.cc (inherit_targ_abi_tags): Likewise. (warn_hidden): Likewise. (maybe_add_class_template_decl_list): Likewise. (check_bases_and_members): Likewise. (dfs_accumulate_vtbl_inits): Likewise. * constexpr.cc (cx_check_missing_mem_inits): Likewise. (cxx_eval_call_expression): Likewise. (modifying_const_object_error): Likewise. (cxx_replaceable_global_alloc_fn): Likewise. * contracts.cc (copy_contracts_list): Likewise. (check_redecl_contract): Likewise. (update_late_contract): Likewise. (get_precondition_function): Likewise. * coroutines.cc (cp_coroutine_transform::build_ramp_function): Likewise. * cp-tree.def (DISJ_CONSTR): Likewise. * cp-tree.h (struct lang_decl_base): Likewise. (SCOPE_DEPTH): Likewise. (set_anon_aggr_type_field): Likewise. (struct cp_decl_specifier_seq): Likewise. * decl.cc (reshape_init_array_1): Likewise. (omp_declare_variant_finalize): Likewise. (grokdeclarator): Likewise. (copy_type_enum): Likewise. * decl2.cc (struct priority_map_traits): Likewise. (determine_visibility): Likewise. (constrain_class_visibility): Likewise. (one_static_initialization_or_destruction): Likewise. * g++spec.cc (lang_specific_driver): Likewise. * init.cc (constant_value_1): Likewise. (build_new): Likewise. * mangle.cc (write_unqualified_name): Likewise. * method.cc (inherited_ctor_binfo): Likewise. (synthesized_method_walk): Likewise. * module.cc (GTY): Likewise. (trees_out::lang_decl_bools): Likewise. (trees_out::core_vals): Likewise. (trees_in::core_vals): Likewise. (trees_in::install_implicit_member): Likewise. (trees_in::odr_duplicate): Likewise. (instantiating_tu_local_entity): Likewise. (sort_cluster): Likewise. (module_state::write_define): Likewise. (module_state::write_begin): Likewise. (declare_module): Likewise. (init_modules): Likewise. * name-lookup.cc (name_lookup::ambiguous): Likewise. (pushdecl): Likewise. (suggest_alternatives_for_1): Likewise. (maybe_add_fuzzy_decl): Likewise. * name-lookup.h (INHERITED_VALUE_BINDING_P): Likewise. (HIDDEN_TYPE_BINDING_P): Likewise. (BINDING_VECTOR_GLOBAL_DUPS_P): Likewise. * operators.def: Likewise. * parser.cc (cp_lexer_new_main): Likewise. (get_cast_suggestion): Likewise. (cp_parser_expression): Likewise. (cp_parser_simple_type_specifier): Likewise. (cp_parser_noexcept_specification_opt): Likewise. (cp_parser_lookup_name): Likewise. (class_decl_loc_t::diag_mismatched_tags): Likewise. (cp_parser_cache_defarg): Likewise. (cp_parser_objc_statement): Likewise. (cp_parser_omp_loop_nest): Likewise. (cp_parser_omp_taskloop): Likewise. (cp_parser_objc_at_property_declaration): Likewise. * parser.h (struct cp_unparsed_functions_entry): Likewise. * pt.cc (tsubst_friend_class): Likewise. (use_pack_expansion_extra_args_p): Likewise. (tsubst_unary_left_fold): Likewise. (tsubst_unary_right_fold): Likewise. (filter_memfn_lookup): Likewise. * semantics.cc (maybe_convert_cond): Likewise. (finish_switch_cond): Likewise. (cp_finish_omp_clause_doacross_sink): Likewise. (finish_omp_target_clauses_r): Likewise. * tree.cc (build_cplus_new): Likewise. (apply_identity_attributes): Likewise. * vtable-class-hierarchy.cc (vtv_compute_class_hierarchy_transitive_closure): Likewise. (vtv_generate_init_routine): Likewise. Diff: --- gcc/cp/call.cc | 8 ++++---- gcc/cp/class.cc | 12 ++++++------ gcc/cp/constexpr.cc | 10 +++++----- gcc/cp/contracts.cc | 10 +++++----- gcc/cp/coroutines.cc | 4 ++-- gcc/cp/cp-tree.def | 2 +- gcc/cp/cp-tree.h | 10 +++++----- gcc/cp/decl.cc | 8 ++++---- gcc/cp/decl2.cc | 8 ++++---- gcc/cp/g++spec.cc | 2 +- gcc/cp/init.cc | 4 ++-- gcc/cp/mangle.cc | 2 +- gcc/cp/method.cc | 4 ++-- gcc/cp/module.cc | 36 ++++++++++++++++++------------------ gcc/cp/name-lookup.cc | 12 ++++++------ gcc/cp/name-lookup.h | 6 +++--- gcc/cp/operators.def | 2 +- gcc/cp/parser.cc | 26 +++++++++++++------------- gcc/cp/parser.h | 2 +- gcc/cp/pt.cc | 10 +++++----- gcc/cp/semantics.cc | 8 ++++---- gcc/cp/tree.cc | 4 ++-- gcc/cp/vtable-class-hierarchy.cc | 8 ++++---- 23 files changed, 99 insertions(+), 99 deletions(-) diff --git a/gcc/cp/call.cc b/gcc/cp/call.cc index 97cb0d6f0124..25fe58ffe64c 100644 --- a/gcc/cp/call.cc +++ b/gcc/cp/call.cc @@ -1711,7 +1711,7 @@ reference_compatible_p (tree t1, tree t2) static bool involves_qualification_conversion_p (tree to, tree from) { - /* If we're not convering a pointer to another one, we won't get + /* If we're not converting a pointer to another one, we won't get a qualification conversion. */ if (!((TYPE_PTR_P (to) && TYPE_PTR_P (from)) || (TYPE_PTRDATAMEM_P (to) && TYPE_PTRDATAMEM_P (from)))) @@ -4700,7 +4700,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags, struct z_candidate *old_candidates; /* If LOOKUP_NO_CONVERSION, don't consider a conversion function that - would need an addional user-defined conversion, i.e. if the return + would need an additional user-defined conversion, i.e. if the return type differs in class-ness from the desired type. So we avoid considering operator bool when calling a copy constructor. @@ -8452,7 +8452,7 @@ complain_about_access (tree decl, tree diag_decl, tree diag_location, error ("%q#D is protected within this context", diag_decl); inform (DECL_SOURCE_LOCATION (diag_location), "declared protected here"); } - /* Couldn't figure out why DECL is inaccesible, so just say it's + /* Couldn't figure out why DECL is inaccessible, so just say it's inaccessible. */ else { @@ -11416,7 +11416,7 @@ maybe_warn_class_memaccess (location_t loc, tree fndecl, else srctype = TREE_TYPE (srctype); - /* Since it's impossible to determine wheter the byte copy is + /* Since it's impossible to determine whether the byte copy is being used in place of assignment to an existing object or as a substitute for initialization, assume it's the former. Determine the best alternative to use instead depending on diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc index 6e4dc3cb0930..a20fad116e71 100644 --- a/gcc/cp/class.cc +++ b/gcc/cp/class.cc @@ -2005,7 +2005,7 @@ inherit_targ_abi_tags (tree t) } /* Return true, iff class T has a non-virtual destructor that is - accessible from outside the class heirarchy (i.e. is public, or + accessible from outside the class hierarchy (i.e. is public, or there's a suitable friend. */ static bool @@ -3289,7 +3289,7 @@ warn_hidden (tree t) unsigned j; size_t num_overriders = 0; hash_set<tree> overriden_base_fndecls; - /* base_fndecls that are hidden but not overriden. The "value" + /* base_fndecls that are hidden but not overridden. The "value" contains the last fndecl we saw that hides the "key". */ hash_map<tree, tree> hidden_base_fndecls; @@ -3455,9 +3455,9 @@ maybe_add_class_template_decl_list (tree type, tree t, int friend_p) /* This function is called from declare_virt_assop_and_dtor via dfs_walk_all. - DATA is a type that direcly or indirectly inherits the base + DATA is a type that directly or indirectly inherits the base represented by BINFO. If BINFO contains a virtual assignment [copy - assignment or move assigment] operator or a virtual constructor, + assignment or move assignment] operator or a virtual constructor, declare that function in DATA if it hasn't been already declared. */ static tree @@ -6483,7 +6483,7 @@ check_bases_and_members (tree t) /* Deduce noexcept on destructor. This needs to happen after we've set triviality flags appropriately for our bases, and before checking - overriden virtual functions via check_methods. */ + overridden virtual functions via check_methods. */ if (cxx_dialect >= cxx11) if (tree dtor = CLASSTYPE_DESTRUCTOR (t)) for (tree fn : ovl_range (dtor)) @@ -10493,7 +10493,7 @@ dfs_accumulate_vtbl_inits (tree binfo, straighten this out. */ BINFO_VTABLE (binfo) = tree_cons (rtti_binfo, vtbl, BINFO_VTABLE (binfo)); else if (BINFO_PRIMARY_P (binfo) && BINFO_VIRTUAL_P (binfo)) - /* Throw away any unneeded intializers. */ + /* Throw away any unneeded initializers. */ (*l)->truncate (n_inits); else /* For an ordinary vtable, set BINFO_VTABLE. */ diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index c5b7aa6685c5..97dde5a310d3 100644 --- a/gcc/cp/constexpr.cc +++ b/gcc/cp/constexpr.cc @@ -878,7 +878,7 @@ cx_check_missing_mem_inits (tree ctype, tree body, bool complain) } ftype = TREE_TYPE (field); if (!ftype || !TYPE_P (ftype) || !COMPLETE_TYPE_P (ftype)) - /* A flexible array can't be intialized here, so don't complain + /* A flexible array can't be initialized here, so don't complain that it isn't. */ continue; if (is_empty_field (field)) @@ -920,7 +920,7 @@ cx_check_missing_mem_inits (tree ctype, tree body, bool complain) } /* We are processing the definition of the constexpr function FUN. - Check that its body fulfills the apropriate requirements and + Check that its body fulfills the appropriate requirements and enter it in the constexpr function definition table. */ void @@ -3350,7 +3350,7 @@ modifying_const_object_error (tree expr, tree obj) } /* Return true if FNDECL is a replaceable global allocation function that - should be useable during constant expression evaluation. */ + should be usable during constant expression evaluation. */ static inline bool cxx_replaceable_global_alloc_fn (tree fndecl) @@ -3363,7 +3363,7 @@ cxx_replaceable_global_alloc_fn (tree fndecl) } /* Return true if FNDECL is a placement new function that should be - useable during constant expression evaluation of std::construct_at. */ + usable during constant expression evaluation of std::construct_at. */ static inline bool cxx_placement_new_fn (tree fndecl) @@ -4689,7 +4689,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t, However, in C++20, a constexpr constructor doesn't necessarily have to initialize all the fields, so we don't clear CONSTRUCTOR_NO_CLEARING - in order to detect reading an unitialized object in constexpr instead + in order to detect reading an uninitialized object in constexpr instead of value-initializing it. (reduced_constant_expression_p is expected to take care of clearing the flag.) */ if (TREE_CODE (result) == CONSTRUCTOR diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc index 37f0daf18633..112bd9daeefa 100644 --- a/gcc/cp/contracts.cc +++ b/gcc/cp/contracts.cc @@ -65,7 +65,7 @@ along with GCC; see the file COPYING3. If not see 'pre' and 'post' function contract specifiers require most of the special handling, since they must be tracked across re-declarations of functions and - there are contraints on how such specifiers may change in these cases. + there are constraints on how such specifiers may change in these cases. The contracts specification identifies a "first declaration" of any given function - which is the first encountered when parsing a given TU. @@ -1231,7 +1231,7 @@ copy_contracts_list (tree contracts, tree fndecl, return new_contracts; } -/* Returns a copy of FNDECL contracts. This is used when emiting a contract. +/* Returns a copy of FNDECL contracts. This is used when emitting a contract. If we were to emit the original contract tree, any folding of the contract condition would affect the original contract too. The original contract tree needs to be preserved in case it is used to apply to a different @@ -1686,7 +1686,7 @@ check_redecl_contract (tree newdecl, tree olddecl) && contract_any_deferred_p (new_contracts) && DECL_UNIQUE_FRIEND_P (newdecl)) { - /* Put the defered contracts on the olddecl so we parse it when + /* Put the deferred contracts on the olddecl so we parse it when we can. */ set_fn_contract_specifiers (olddecl, old_contracts); } @@ -2150,7 +2150,7 @@ update_late_contract (tree contract, tree result, cp_expr condition) CONTRACT_CONDITION (contract) = condition; } -/* Returns the precondition funtion for FNDECL, or null if not set. */ +/* Returns the precondition function for FNDECL, or null if not set. */ tree get_precondition_function (tree fndecl) @@ -2160,7 +2160,7 @@ get_precondition_function (tree fndecl) return result ? *result : NULL_TREE; } -/* Returns the postcondition funtion for FNDECL, or null if not set. */ +/* Returns the postcondition function for FNDECL, or null if not set. */ tree get_postcondition_function (tree fndecl) diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc index de0de7a83e04..46ec8c0a953e 100644 --- a/gcc/cp/coroutines.cc +++ b/gcc/cp/coroutines.cc @@ -5059,7 +5059,7 @@ cp_coroutine_transform::build_ramp_function () = build_coroutine_frame_alloc_expr (promise_type, orig_fn_decl, fn_start, grooaf, ¶m_uses, frame_size); - /* We must have a useable allocator to proceed. */ + /* We must have a usable allocator to proceed. */ if (!new_fn_call || new_fn_call == error_mark_node) return false; @@ -5358,7 +5358,7 @@ cp_coroutine_transform::build_ramp_function () else { /* Per CWG2563, we keep the result of promise.get_return_object () in - a temp which is then used to intialize the return object, including + a temp which is then used to initialize the return object, including NVRO. */ coro_gro diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def index 3826b143a967..7b3cee5cf6e7 100644 --- a/gcc/cp/cp-tree.def +++ b/gcc/cp/cp-tree.def @@ -547,7 +547,7 @@ DEFTREECODE (DISJ_CONSTR, "disj_constr", tcc_expression, 2) /* The co_await expression is used to support coroutines. - Op 0 is the cast expresssion (potentially modified by the + Op 0 is the cast expression (potentially modified by the promise "await_transform()" method). Op1 is a proxy for the temp / coro frame slot 'e' value. Op2 is the initialiser for Op1 (Op0, potentially modified by any diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 6a8adbc18caf..65f112714d14 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3200,7 +3200,7 @@ struct GTY(()) lang_decl_base { unsigned module_purview_p : 1; /* in named-module purview */ unsigned module_attach_p : 1; /* attached to named module */ unsigned module_import_p : 1; /* from an import */ - unsigned module_entity_p : 1; /* is in the entitity ary & hash */ + unsigned module_entity_p : 1; /* is in the entity ary & hash */ unsigned module_keyed_decls_p : 1; /* has keys, applies to all decls */ @@ -3971,7 +3971,7 @@ struct GTY(()) lang_decl { #define SCOPE_DEPTH(NODE) \ (NAMESPACE_DECL_CHECK (NODE)->base.u.bits.address_space) -/* Whether the namepace is an inline namespace. */ +/* Whether the namespace is an inline namespace. */ #define DECL_NAMESPACE_INLINE_P(NODE) \ TREE_LANG_FLAG_0 (NAMESPACE_DECL_CHECK (NODE)) @@ -5548,7 +5548,7 @@ set_anon_aggr_type_field (tree &typeinfo_var) TYPE_DECL). FIXME: const_cast<tree> is a hack that hopefully will go away after - tree is converted to C++ class hiearchy. */ + tree is converted to C++ class hierarchy. */ #define DECL_TEMPLATE_PARMS(NODE) \ ((struct tree_template_decl *)const_cast<tree> (TEMPLATE_DECL_CHECK \ (NODE)))->arguments @@ -5559,7 +5559,7 @@ set_anon_aggr_type_field (tree &typeinfo_var) /* For function, method, class-data templates. FIXME: const_cast<tree> is a hack that hopefully will go away after - tree is converted to C++ class hiearchy. */ + tree is converted to C++ class hierarchy. */ #define DECL_TEMPLATE_RESULT(NODE) \ ((struct tree_template_decl *)const_cast<tree> (TEMPLATE_DECL_CHECK \ (NODE)))->result @@ -6971,7 +6971,7 @@ enum cp_decl_spec { /* A decl-specifier-seq. */ struct cp_decl_specifier_seq { - /* An array of locations for the declaration sepecifiers, indexed by + /* An array of locations for the declaration specifiers, indexed by enum cp_decl_spec_word. */ location_t locations[ds_last]; /* The primary type, if any, given by the decl-specifier-seq. diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 21a57d01deeb..457d60bcd055 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -7609,7 +7609,7 @@ reshape_init_array_1 (tree elt_type, tree max_index, reshape_iter *d, else midx = tree_to_poly_uint64 (fold_convert (size_type_node, max_index)); - /* For VLA vectors, we restict the number of elements in the constructor + /* For VLA vectors, we restrict the number of elements in the constructor to lower bound of the VLA elements. */ max_index_cst = constant_lower_bound (midx); } @@ -9418,7 +9418,7 @@ omp_declare_variant_finalize (tree decl, tree attr) } /* This loop is like private_lookup_attribute, except that it works with tree * rather than tree, as we might want to remove the - attributes that are diagnosed as errorneous. */ + attributes that are diagnosed as erroneous. */ while (*list) { tree attr = get_attribute_name (*list); @@ -15815,7 +15815,7 @@ grokdeclarator (const cp_declarator *declarator, id_loc = declarator ? declarator->id_loc : input_location; if (innermost_code != cdk_function - /* Don't check this if it can be the artifical decltype(auto) + /* Don't check this if it can be the artificial decltype(auto) we created when building a constraint in a compound-requirement: that the type-constraint is plain is going to be checked in cp_parser_compound_requirement. */ @@ -18865,7 +18865,7 @@ copy_type_enum (tree dst, tree src) /* Begin compiling the definition of an enumeration type. NAME is its name, - if ENUMTYPE is not NULL_TREE then the type has alredy been found. + if ENUMTYPE is not NULL_TREE then the type has already been found. UNDERLYING_TYPE is the type that will be used as the storage for the enumeration type. This should be NULL_TREE if no storage type diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc index 785f669348ef..0e7dad50ab55 100644 --- a/gcc/cp/decl2.cc +++ b/gcc/cp/decl2.cc @@ -157,7 +157,7 @@ struct priority_map_traits { entry.m_key = 0; } - // Entries are not deleteable + // Entries are not deletable template <typename T> static bool is_deleted (const T &) { return false; @@ -3304,7 +3304,7 @@ determine_visibility (tree decl) enum symbol_visibility orig_visibility = DECL_VISIBILITY (decl); /* The decl may be a template instantiation, which could influence - visibilty. */ + visibility. */ tree template_decl = NULL_TREE; if (TREE_CODE (decl) == TYPE_DECL) { @@ -3670,7 +3670,7 @@ constrain_class_visibility (tree type) types and declarations when it gets a name for linkage purposes from a typedef. */ // FIXME: It is now a DR for such a class type to contain anything -// other than C. So at minium most of this can probably be deleted. +// other than C. So at minimum most of this can probably be deleted. /* First reset the visibility of all the types. */ @@ -4862,7 +4862,7 @@ one_static_initialization_or_destruction (bool initp, tree decl, tree init, /* Helper function for emit_partial_init_fini_fn and handle_tls_init. For structured bindings, disable stmts_are_full_exprs_p () - on STATIC_INIT_DECOMP_BASE_P nodes, reenable it on the + on STATIC_INIT_DECOMP_BASE_P nodes, re-enable it on the first STATIC_INIT_DECOMP_NONBASE_P node and emit all the STATIC_INIT_DECOMP_BASE_P and STATIC_INIT_DECOMP_NONBASE_P consecutive nodes in a single STATEMENT_LIST wrapped with diff --git a/gcc/cp/g++spec.cc b/gcc/cp/g++spec.cc index ab6482d4f5d3..f80432449132 100644 --- a/gcc/cp/g++spec.cc +++ b/gcc/cp/g++spec.cc @@ -115,7 +115,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, /* "-lm" or "-lmath" if it appears on the command line. */ const struct cl_decoded_option *saw_math = NULL; - /* "-lrt" or eqivalent if it appears on the command line. */ + /* "-lrt" or equivalent if it appears on the command line. */ const struct cl_decoded_option *saw_time = NULL; /* "-lc" if it appears on the command line. */ diff --git a/gcc/cp/init.cc b/gcc/cp/init.cc index 975bbd6a61eb..14ceafa68284 100644 --- a/gcc/cp/init.cc +++ b/gcc/cp/init.cc @@ -2612,7 +2612,7 @@ constant_value_1 (tree decl, bool strict_p, bool return_aggregate_cst_ok_p, init = TREE_VALUE (init); /* Instantiate a non-dependent initializer for user variables. We mustn't do this for the temporary for an array compound literal; - trying to instatiate the initializer will keep creating new + trying to instantiate the initializer will keep creating new temporaries until we crash. Probably it's not useful to do it for other artificial variables, either. */ if (!DECL_ARTIFICIAL (decl)) @@ -4098,7 +4098,7 @@ build_new (location_t loc, vec<tree, va_gc> **placement, tree type, /* The expression in a noptr-new-declarator is erroneous if it's of non-class type and its value before converting to std::size_t is less than zero. ... If the expression is a constant expression, - the program is ill-fomed. */ + the program is ill-formed. */ if (TREE_CODE (cst_nelts) == INTEGER_CST && !valid_array_size_p (nelts_loc, cst_nelts, NULL_TREE, complain & tf_error)) diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc index 2605f8505cdc..982864ebf0c6 100644 --- a/gcc/cp/mangle.cc +++ b/gcc/cp/mangle.cc @@ -1653,7 +1653,7 @@ write_unqualified_name (tree decl) decl = res; else if (flag_abi_version == 10) { - /* In ABI 10, we want explict and implicit tags. */ + /* In ABI 10, we want explicit and implicit tags. */ write_abi_tags (mtags); return; } diff --git a/gcc/cp/method.cc b/gcc/cp/method.cc index ccfcfb202aa4..ebc5bef5ceea 100644 --- a/gcc/cp/method.cc +++ b/gcc/cp/method.cc @@ -560,7 +560,7 @@ inherited_ctor_binfo (tree fndecl) /* True if we should omit all user-declared parameters from a base - construtor built from complete constructor FN. + constructor built from complete constructor FN. That's when the ctor is inherited from a virtual base. */ bool @@ -3167,7 +3167,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p, else if (ABSTRACT_CLASS_TYPE_P (ctype) && cxx_dialect >= cxx14 /* DR 1658 specifies that vbases of abstract classes are ignored for both ctors and dtors. Except DR 2336 - overrides that skipping when determing the eh-spec of a + overrides that skipping when determining the eh-spec of a virtual destructor. */ && sfk != sfk_virtual_destructor) /* Vbase cdtors are not relevant. */; diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 02e53ef39697..d4d47ed26a95 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see /* Comments in this file have a non-negligible chance of being wrong or at least inaccurate. Due to (a) my misunderstanding, (b) - ambiguities that I have interpretted differently to original intent + ambiguities that I have interpreted differently to original intent (c) changes in the specification, (d) my poor wording, (e) source changes. */ @@ -42,7 +42,7 @@ along with GCC; see the file COPYING3. If not see Additionally each imported decl is mapped in the entity_map via its DECL_UID to the flat index in the entity_ary. Thus we can locate the index for any imported decl by using this map and then - de-flattening the index via a binary seach of the module vector. + de-flattening the index via a binary search of the module vector. Cross-module references are by (remapped) module number and module-local index. @@ -188,7 +188,7 @@ Classes used: The mapper object uses fileno IO to communicate with the server or program. */ -/* In expermental (trunk) sources, MODULE_VERSION is a #define passed +/* In experimental (trunk) sources, MODULE_VERSION is a #define passed in from the Makefile. It records the modification date of the source directory -- that's the only way to stay sane. In release sources, we (plan to) use the compiler's major.minor versioning. @@ -323,7 +323,7 @@ version2string (unsigned version, verstr_t &out) /* Include files to note translation for. */ static vec<const char *, va_heap, vl_embed> *note_includes; -/* Modules to note CMI pathames. */ +/* Modules to note CMI pathnames. */ static vec<const char *, va_heap, vl_embed> *note_cmis; /* Traits to hash an arbitrary pointer. Entries are not deletable, @@ -2846,7 +2846,7 @@ pending_map_t *pending_table; completed. */ vec<tree, va_heap, vl_embed> *post_load_decls; -/* Some entities are keyed to another entitity for ODR purposes. +/* Some entities are keyed to another entity for ODR purposes. For example, at namespace scope, 'inline auto var = []{};', that lambda is keyed to 'var', and follows its ODRness. */ typedef hash_map<tree, auto_vec<tree>> keyed_map_t; @@ -4220,7 +4220,7 @@ static GTY(()) vec<tree, va_gc> *class_members; expecting them in the instantiation table no longer holds. One of the constrained partial specializations will be there, but the others not so much. It's not even an unconstrained partial - spacialization in the table :( so any partial template declaration + specialization in the table :( so any partial template declaration is added to this list too. */ static GTY(()) vec<tree, va_gc> *partial_specializations; @@ -6110,7 +6110,7 @@ trees_out::lang_decl_bools (tree t, bits_out& bits) WB (lang->u.base.var_declared_inline_p); WB (lang->u.base.dependent_init_p); - /* When building a header unit, everthing is marked as purview, (so + /* When building a header unit, everything is marked as purview, (so we know which decls to write). But when we import them we do not want to mark them as in module purview. */ WB (lang->u.base.module_purview_p && !header_module_p ()); @@ -6563,7 +6563,7 @@ trees_out::core_vals (tree t) && TREE_CODE_CLASS (code) != tcc_vl_exp); /* Then by CODE. Special cases and/or 1:1 tree shape - correspondance. */ + correspondence. */ switch (code) { default: @@ -7146,7 +7146,7 @@ trees_in::core_vals (tree t) } /* Then by CODE. Special cases and/or 1:1 tree shape - correspondance. */ + correspondence. */ switch (code) { default: @@ -7168,7 +7168,7 @@ trees_in::core_vals (tree t) break; case FIXED_CST: - /* Not suported in C++. */ + /* Not supported in C++. */ return false; case INTEGER_CST: @@ -12920,7 +12920,7 @@ trees_in::install_implicit_member (tree fn) tree name = DECL_NAME (fn); /* We know these are synthesized, so the set of expected prototypes is quite restricted. We're not validating correctness, just - distinguishing beteeen the small set of possibilities. */ + distinguishing between the small set of possibilities. */ tree parm_type = TREE_VALUE (FUNCTION_FIRST_USER_PARMTYPE (fn)); if (IDENTIFIER_CTOR_P (name)) { @@ -13129,7 +13129,7 @@ trees_in::odr_duplicate (tree maybe_existing, bool has_defn) /* The following writer functions rely on the current behaviour of depset::hash::add_dependency making the decl and defn depset nodes - depend on eachother. That way we don't have to worry about seeding + depend on each other. That way we don't have to worry about seeding the tree map with named decls that cannot be looked up by name (I.e template and function parms). We know the decl and definition will be in the same cluster, which is what we want. */ @@ -14568,7 +14568,7 @@ instantiating_tu_local_entity (tree decl) inform (DECL_SOURCE_LOCATION (decl), "declared here"); /* We treat TU-local entities from the GMF as not actually being - TU-local as an extension, so allow instantation to proceed. */ + TU-local as an extension, so allow instantiation to proceed. */ return false; } @@ -16299,7 +16299,7 @@ sort_cluster (depset::hash *original, depset *scc[], unsigned size) The instantiation of TPL will be in the specialization table, and refer to Foo via arg. But we can only get to that specialization - from Foo's declaration, so we only need to treat Foo as mergable + from Foo's declaration, so we only need to treat Foo as mergeable (We'll do structural comparison of TPL<decltype (arg)>). We approximate finding the single cluster entry dep by checking for @@ -19662,7 +19662,7 @@ module_state::write_define (bytes_out &sec, const cpp_macro *macro) case CPP_TOKEN_FLD_STR: /* A string, number or comment. Not always NUL terminated, - we stream out in a single contatenation with embedded + we stream out in a single concatenation with embedded NULs as that's a safe default. */ len += token->val.str.len + 1; sec.u (token->val.str.len); @@ -21203,7 +21203,7 @@ module_state::write_begin (elf_out *to, cpp_reader *reader, gcc_assert (counts[MSC_sec_hwm] == to->get_section_limit () && spaces.length () == counts[MSC_namespaces]); - /* Write the entitites. None happens if we contain namespaces or + /* Write the entities. None happens if we contain namespaces or nothing. */ config.num_entities = counts[MSC_entities]; if (counts[MSC_entities]) @@ -22859,7 +22859,7 @@ declare_module (module_state *module, location_t from_loc, bool exporting_p, { /* Copy the importing information we may have already done. We do not need to separate out the imports that only happen in - the GMF, inspite of what the literal wording of the std + the GMF, in spite of what the literal wording of the std might imply. See p2191, the core list had a discussion where the module implementors agreed that the GMF of a named module is invisible to importers. */ @@ -23579,7 +23579,7 @@ void init_modules (cpp_reader *reader) { /* PCH should not be reachable because of lang-specs, but the - user could have overriden that. */ + user could have overridden that. */ if (pch_file) fatal_error (input_location, "C++ modules are incompatible with precompiled headers"); diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index ef8440883819..31ade88f75b5 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -550,8 +550,8 @@ vec<tree, va_heap, vl_embed> *name_lookup::shared_scopes; /* Currently active lookup. */ name_lookup *name_lookup::active; -/* Name lookup is recursive, becase ADL can cause template - instatiation. This is of course a rare event, so we optimize for +/* Name lookup is recursive, because ADL can cause template + instantiation. This is of course a rare event, so we optimize for it not happening. When we discover an active name-lookup, which must be an ADL lookup, we need to unmark the marked scopes and also unmark the lookup we might have been accumulating. */ @@ -681,7 +681,7 @@ name_lookup::ambiguous (tree thing, tree current) return current; } -/* FNS is a new overload set to add to the exising set. */ +/* FNS is a new overload set to add to the existing set. */ void name_lookup::add_overload (tree fns) @@ -4236,7 +4236,7 @@ pushdecl (tree decl, bool hiding) if (level->kind != sk_namespace && !instantiating_current_function_p ()) /* This is a locally defined typedef in a function that - is not a template instantation, record it to implement + is not a template instantiation, record it to implement -Wunused-local-typedefs. */ record_locally_defined_typedef (decl); } @@ -7498,7 +7498,7 @@ suggest_alternatives_for_1 (location_t location, tree name, Search through all available namespaces and generate a suggestion and/or a deferred diagnostic that lists possible candidate(s). - This is similiar to suggest_alternatives_for, but doesn't fallback to + This is similar to suggest_alternatives_for, but doesn't fallback to the other approaches used by that function. */ name_hint @@ -7812,7 +7812,7 @@ maybe_add_fuzzy_decl (auto_vec<tree> &vec, tree decl) return true; } -/* Examing the namespace binding BINDING, and add at most one instance +/* Examine the namespace binding BINDING, and add at most one instance of the name, if it contains a visible entity of interest. Return true if we added something. */ diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index cd0799a80ded..2e541f58b9bd 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -36,13 +36,13 @@ struct cp_binding_level; #define INHERITED_VALUE_BINDING_P(NODE) ((NODE)->value_is_inherited) /* The IMPLICIT_TYPEDEF is hidden from ordinary name lookup (it was - injected via a local class's friend decl). The typdef may be in the + injected via a local class's friend decl). The typedef may be in the VALUE or the TYPE slot. We do not get the situation where the value and type slots are both filled and both hidden. */ #define HIDDEN_TYPE_BINDING_P(NODE) ((NODE)->type_is_hidden) /* Create an overload suitable for recording an artificial TYPE_DECL - and another decl. We use this machanism to implement the struct + and another decl. We use this mechanism to implement the struct stat hack. */ #define STAT_HACK_P(N) ((N) && TREE_CODE (N) == OVERLOAD && OVL_LOOKUP_P (N)) @@ -193,7 +193,7 @@ struct GTY(()) tree_binding_vec { entity. */ #define BINDING_VECTOR_GLOBAL_DUPS_P(NODE) \ (BINDING_VECTOR_CHECK (NODE)->base.static_flag) -/* This binding contains duplicate references to a partioned module +/* This binding contains duplicate references to a partitioned module entity. */ #define BINDING_VECTOR_PARTITION_DUPS_P(NODE) \ (BINDING_VECTOR_CHECK (NODE)->base.volatile_flag) diff --git a/gcc/cp/operators.def b/gcc/cp/operators.def index 9f2c581ece11..28ef2b96a574 100644 --- a/gcc/cp/operators.def +++ b/gcc/cp/operators.def @@ -61,7 +61,7 @@ along with GCC; see the file COPYING3. If not see There is code (such as in grok_op_properties) that depends on the order the operators are presented in this file. Unary_ops must - preceed a matching binary op (i.e. '+'). Assignment operators must + precede a matching binary op (i.e. '+'). Assignment operators must be last, after OPERATOR_TRANSITION. */ /* Use DEF_ASSN_OPERATOR to define an assignment operator. Its diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index b5c8c62118cc..f25ce71a237d 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -857,7 +857,7 @@ cp_lexer_new_main (void) by the current token which is either not a CPP_NUMBER (e.g. often CPP_CLOSE_BRACE), or CPP_NUMBER with non-int type or with value not in [0, UCHAR_MAX], or reaching the raw_data_max_len - limit. So we need to substract 1 (to get at the current token + limit. So we need to subtract 1 (to get at the current token index) plus 3 + !last_number to get at the CPP_EMBED index. */ unsigned int idx = lexer->buffer->length () - 4 - !last_number; if (!last_number) @@ -907,7 +907,7 @@ cp_lexer_new_main (void) { /* Set the EOF token's location to be the just after the previous token's range. That way 'at-eof' diagnostics point at something - meaninful. */ + meaningful. */ auto range = get_range_from_loc (line_table, tok[-1].location); tok[0].location = linemap_position_for_loc_and_offset (line_table, range.m_finish, 1); @@ -11331,7 +11331,7 @@ get_cast_suggestion (tree dst_type, tree orig_expr) to a C++-style cast. - The primary range of RICHLOC is asssumed to be that of the original + The primary range of RICHLOC is assumed to be that of the original expression. OPEN_PAREN_LOC and CLOSE_PAREN_LOC give the locations of the parens in the C-style cast. */ @@ -12152,7 +12152,7 @@ cp_parser_expression (cp_parser* parser, cp_id_kind * pidk, /* Parse the next assignment-expression. */ if (cp_lexer_next_token_is (parser->lexer, CPP_EMBED)) { - /* Users aren't interested in milions of -Wunused-value + /* Users aren't interested in millions of -Wunused-value warnings when using #embed inside of a comma expression, and one CPP_NUMBER plus CPP_COMMA before it and one CPP_COMMA plus CPP_NUMBER after it is guaranteed by @@ -23056,7 +23056,7 @@ cp_parser_simple_type_specifier (cp_parser* parser, return type; } -/* Parse the remainder of a placholder-type-specifier. +/* Parse the remainder of a placeholder-type-specifier. placeholder-type-specifier: type-constraint_opt auto @@ -32199,7 +32199,7 @@ cp_parser_noexcept_specification_opt (cp_parser* parser, { tree expr; - /* [class.mem]/6 says that a noexcept-specifer (within the + /* [class.mem]/6 says that a noexcept-specifier (within the member-specification of the class) is a complete-class context of a class. So, if the noexcept-specifier has the optional expression, just save the tokens, and reparse this after we're done with the @@ -35430,7 +35430,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name, } /* If the scope is a dependent type and either we deferred lookup or - we did lookup but didn't find the name, rememeber the name. */ + we did lookup but didn't find the name, remember the name. */ if (decl == error_mark_node && ((TYPE_P (parser->scope) && dependentish_scope_p (parser->scope)) @@ -38657,7 +38657,7 @@ class_decl_loc_t::diag_mismatched_tags (tree type_decl) auto_diagnostic_group d; /* Issue a warning for the first mismatched declaration. Avoid using "%#qT" since the class-key for the same type will - be the same regardless of which one was used in the declaraion. */ + be the same regardless of which one was used in the declaration. */ if (warning_at (loc, OPT_Wmismatched_tags, "%qT declared with a mismatched class-key %qs", type_decl, xmatchkstr)) @@ -38926,7 +38926,7 @@ cp_parser_cache_defarg (cp_parser *parser, bool nsdmi) if (nsdmi) { /* Parse declarators until we reach a non-comma or - somthing that cannot be an initializer. + something that cannot be an initializer. Just checking whether we're looking at a single declarator is insufficient. Consider: int var = tuple<T,U>::x; @@ -40782,7 +40782,7 @@ cp_parser_objc_statement (cp_parser * parser) return error_mark_node; } -/* If we are compiling ObjC++ and we see an __attribute__ we neeed to +/* If we are compiling ObjC++ and we see an __attribute__ we need to look ahead to see if an objc keyword follows the attributes. This is to detect the use of prefix attributes on ObjC @interface and @protocol. */ @@ -41082,7 +41082,7 @@ cp_parser_objc_at_property_declaration (cp_parser *parser) } /* If we see a comma here, then keep going - even if we already - saw a syntax error. For simple mistakes e.g. (asign, getter=x) + saw a syntax error. For simple mistakes e.g. (assign, getter=x) this makes a more useful output and avoid spurious warnings about missing attributes that are, in fact, specified after the one with the syntax error. */ @@ -50012,7 +50012,7 @@ cp_parser_omp_loop_nest (cp_parser *parser, bool *if_p) of the variables from intervening code. However, putting this code in each level of loop instead of all around the innermost body also makes the decomposition variables visible to the - inner for init/bound/step exressions, which is not supposed to + inner for init/bound/step expressions, which is not supposed to happen and causes test failures. */ if (omp_for_parse_state->orig_declv) for (int i = 0; i < omp_for_parse_state->count; i++) @@ -56380,7 +56380,7 @@ cp_parser_omp_taskloop (cp_parser *parser, cp_token *pragma_tok, /* Parse the OpenACC routine pragma. This has an optional '( name )' component, which must resolve to a declared namespace-scope function. The clauses are either processed directly (for a named - function), or defered until the immediatley following declaration + function), or deferred until the immediately following declaration is parsed. */ static void diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h index ddef98d900af..24d1c3f5ebb2 100644 --- a/gcc/cp/parser.h +++ b/gcc/cp/parser.h @@ -172,7 +172,7 @@ struct GTY(()) cp_unparsed_functions_entry { Functions appear in this list in declaration order. */ vec<cp_default_arg_entry, va_gc> *funs_with_default_args; - /* Functions with defintions that require post-processing. Functions + /* Functions with definitions that require post-processing. Functions appear in this list in declaration order. */ vec<tree, va_gc> *funs_with_definitions; diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index ada5f53a9f11..ec8a4efbe297 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -12202,7 +12202,7 @@ tsubst_friend_class (tree friend_tmpl, tree args) newly instantiated template type. */ propagate_defining_module (tmpl, friend_tmpl); - /* Inject this template into the enclosing namspace scope. */ + /* Inject this template into the enclosing namespace scope. */ tmpl = pushdecl_namespace_level (tmpl, /*hiding=*/true); } } @@ -13445,7 +13445,7 @@ use_pack_expansion_extra_args_p (tree t, else if (has_empty_arg) { /* If all the actual packs are pack expansions, we can still - subsitute directly. */ + substitute directly. */ for (tree p = parm_packs; p; p = TREE_CHAIN (p)) { tree a = TREE_VALUE (p); @@ -13729,7 +13729,7 @@ tsubst_unary_left_fold (tree t, tree args, tsubst_flags_t complain, /* Substitute into a binary left fold expression. - Do ths by building a single (non-empty) vector of argumnts and + Do this by building a single (non-empty) vector of arguments and building the expression from those elements. */ static tree @@ -13806,7 +13806,7 @@ tsubst_unary_right_fold (tree t, tree args, tsubst_flags_t complain, /* Substitute into a binary right fold expression. - Do ths by building a single (non-empty) vector of arguments and + Do this by building a single (non-empty) vector of arguments and building the expression from those elements. */ static tree @@ -18106,7 +18106,7 @@ filter_memfn_lookup (tree oldfns, tree newfns, tree newtype) /* tsubst a BASELINK. OBJECT_TYPE, if non-NULL, is the type of the expression on the left-hand side of the "." or "->" operator. We only do the lookup if we had a dependent BASELINK. Otherwise we - adjust it onto the instantiated heirarchy. */ + adjust it onto the instantiated hierarchy. */ static tree tsubst_baselink (tree baselink, tree object_type, diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc index 0d47b20fb3c2..565117fb8fa8 100644 --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -1138,7 +1138,7 @@ maybe_convert_cond (tree cond) /* For structured binding used in condition, the conversion needs to be evaluated before the individual variables are initialized in the - std::tuple_{size,elemenet} case. cp_finish_decomp saved the conversion + std::tuple_{size,element} case. cp_finish_decomp saved the conversion result in a TARGET_EXPR, pick it up from there. */ if (DECL_DECOMPOSITION_P (cond) && DECL_DECOMP_IS_BASE (cond) @@ -1931,7 +1931,7 @@ finish_switch_cond (tree cond, tree switch_stmt) tree orig_cond = cond; /* For structured binding used in condition, the conversion needs to be evaluated before the individual variables are initialized in the - std::tuple_{size,elemenet} case. cp_finish_decomp saved the + std::tuple_{size,element} case. cp_finish_decomp saved the conversion result in a TARGET_EXPR, pick it up from there. */ if (DECL_DECOMPOSITION_P (cond) && DECL_DECOMP_IS_BASE (cond) @@ -7584,7 +7584,7 @@ cp_finish_omp_clause_doacross_sink (tree sink_clause) return false; } -/* Finish OpenMP iterators ITER. Return true if they are errorneous +/* Finish OpenMP iterators ITER. Return true if they are erroneous and clauses containing them should be removed. */ static bool @@ -11049,7 +11049,7 @@ finish_omp_target_clauses_r (tree *tp, int *walk_subtrees, void *ptr) } /* When the current_function_decl is a lambda function, the closure object - argument's type seems to not yet have fields layed out, so a recording + argument's type seems to not yet have fields laid out, so a recording of DECL_VALUE_EXPRs during the target body walk seems the only way to find them. */ if (current_closure diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc index 02a62f78511c..652967175c8d 100644 --- a/gcc/cp/tree.cc +++ b/gcc/cp/tree.cc @@ -855,7 +855,7 @@ build_cplus_new (tree type, tree init, tsubst_flags_t complain) } /* Subroutine of build_vec_init_expr: Build up a single element - intialization as a proxy for the full array initialization to get things + initialization as a proxy for the full array initialization to get things marked as used and any appropriate diagnostics. This used to be necessary because we were deferring building the actual @@ -1724,7 +1724,7 @@ apply_identity_attributes (tree result, tree attribs, bool *remove_attributes) Because of several reasons: * If T is a type that needs structural equality its TYPE_CANONICAL (T) will be NULL. - * TYPE_CANONICAL (T) desn't carry type attributes + * TYPE_CANONICAL (T) doesn't carry type attributes and loses template parameter names. If REMOVE_ATTRIBUTES is non-null, also strip attributes that don't diff --git a/gcc/cp/vtable-class-hierarchy.cc b/gcc/cp/vtable-class-hierarchy.cc index 84bb8a212e6a..2e52ea3c4a0a 100644 --- a/gcc/cp/vtable-class-hierarchy.cc +++ b/gcc/cp/vtable-class-hierarchy.cc @@ -51,7 +51,7 @@ along with GCC; see the file COPYING3. If not see hacker targets. To find and reference the set of valid vtable pointers for any given - virtual class, we create a special global varible for each virtual + virtual class, we create a special global variable for each virtual class. We refer to this as the "vtable map variable" for that class. The vtable map variable has the type "void *", and is initialized by the compiler to NULL. At runtime when the set of @@ -86,7 +86,7 @@ along with GCC; see the file COPYING3. If not see The vtable verification feature is controlled by the flag '-fvtable-verify='. There are three flavors of this: '-fvtable-verify=std', '-fvtable-verify=preinit', and - '-fvtable-verify=none'. If the option '-fvtable-verfy=preinit' is + '-fvtable-verify=none'. If the option '-fvtable-verify=preinit' is used, then our constructor initialization function gets put into the preinit array. This is necessary if there are data sets that need to be built very early in execution. If the constructor @@ -436,7 +436,7 @@ vtv_compute_class_hierarchy_transitive_closure (void) offset into the vtable (VTABLE_DECL). It is the actual vtable pointer address that will be stored in our list of valid vtable pointers for BASE_CLASS. BASE_CLASS is the record_type node for - the base class to whose hiearchy we want to add + the base class to whose hierarchy we want to add VPTR_ADDRESS. (VTABLE_DECL should be the vtable for BASE_CLASS or one of BASE_CLASS' descendents. */ @@ -1194,7 +1194,7 @@ vtv_generate_init_routine (void) pop_lang_context (); } -/* This funtion takes a tree containing a class type (BASE_TYPE), and +/* This function takes a tree containing a class type (BASE_TYPE), and it either finds the existing vtbl_map_node for that class in our data structure, or it creates a new node and adds it to the data structure if there is not one for the class already. As part of
