From: Patrick Palka Date: Mon, 3 Oct 2022 15:20:32 +0000 (-0400) Subject: c++: rename IS_SAME_AS trait code to IS_SAME X-Git-Tag: basepoints/gcc-14~4163 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35b4cbbd70b70592bd7be3b4ff0550e0de1b3b30;p=thirdparty%2Fgcc.git c++: rename IS_SAME_AS trait code to IS_SAME ... to match the trait's canonical spelling __is_same instead of its alternative spelling __is_same_as. gcc/c-family/ChangeLog: * c-common.cc (c_common_reswords): Use RID_IS_SAME instead of RID_IS_SAME_AS. gcc/cp/ChangeLog: * constraint.cc (diagnose_trait_expr): Use CPTK_IS_SAME instead of CPTK_IS_SAME_AS. * cp-trait.def (IS_SAME_AS): Rename to ... (IS_SAME): ... this. * pt.cc (alias_ctad_tweaks): Use CPTK_IS_SAME instead of CPTK_IS_SAME_AS. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. --- diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc index 3c60a89bfe2c..4f9878d26950 100644 --- a/gcc/c-family/c-common.cc +++ b/gcc/c-family/c-common.cc @@ -509,7 +509,7 @@ const struct c_common_resword c_common_reswords[] = #include "cp/cp-trait.def" #undef DEFTRAIT /* An alias for __is_same. */ - { "__is_same_as", RID_IS_SAME_AS, D_CXXONLY }, + { "__is_same_as", RID_IS_SAME, D_CXXONLY }, /* C++ transactional memory. */ { "synchronized", RID_SYNCHRONIZED, D_CXX_OBJC | D_TRANSMEM }, diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index f4145571d92d..74898ca1a23f 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -3649,7 +3649,7 @@ diagnose_trait_expr (tree expr, tree args) case CPTK_IS_POLYMORPHIC: inform (loc, " %qT is not a polymorphic type", t1); break; - case CPTK_IS_SAME_AS: + case CPTK_IS_SAME: inform (loc, " %qT is not the same as %qT", t1, t2); break; case CPTK_IS_STD_LAYOUT: diff --git a/gcc/cp/cp-trait.def b/gcc/cp/cp-trait.def index 922348a16591..823899a26c5d 100644 --- a/gcc/cp/cp-trait.def +++ b/gcc/cp/cp-trait.def @@ -75,7 +75,7 @@ DEFTRAIT_EXPR (IS_NOTHROW_CONVERTIBLE, "__is_nothrow_convertible", 2) DEFTRAIT_EXPR (IS_POINTER_INTERCONVERTIBLE_BASE_OF, "__is_pointer_interconvertible_base_of", 2) DEFTRAIT_EXPR (IS_POD, "__is_pod", 1) DEFTRAIT_EXPR (IS_POLYMORPHIC, "__is_polymorphic", 1) -DEFTRAIT_EXPR (IS_SAME_AS, "__is_same", 2) +DEFTRAIT_EXPR (IS_SAME, "__is_same", 2) DEFTRAIT_EXPR (IS_STD_LAYOUT, "__is_standard_layout", 1) DEFTRAIT_EXPR (IS_TRIVIAL, "__is_trivial", 1) DEFTRAIT_EXPR (IS_TRIVIALLY_ASSIGNABLE, "__is_trivially_assignable", 2) diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 258f76d6e476..bce2a7779220 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -30029,7 +30029,7 @@ alias_ctad_tweaks (tree tmpl, tree uguides) /* FIXME this should mean they don't compare as equivalent. */ || dependent_alias_template_spec_p (atype, nt_opaque)) { - tree same = finish_trait_expr (loc, CPTK_IS_SAME_AS, atype, ret); + tree same = finish_trait_expr (loc, CPTK_IS_SAME, atype, ret); ci = append_constraint (ci, same); } diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc index 4fb0675cca96..5cc5a0014989 100644 --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -12007,7 +12007,7 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2) case CPTK_IS_POLYMORPHIC: return CLASS_TYPE_P (type1) && TYPE_POLYMORPHIC_P (type1); - case CPTK_IS_SAME_AS: + case CPTK_IS_SAME: return same_type_p (type1, type2); case CPTK_IS_STD_LAYOUT: @@ -12193,7 +12193,7 @@ finish_trait_expr (location_t loc, cp_trait_kind kind, tree type1, tree type2) case CPTK_IS_CLASS: case CPTK_IS_ENUM: case CPTK_IS_UNION: - case CPTK_IS_SAME_AS: + case CPTK_IS_SAME: break; case CPTK_IS_LAYOUT_COMPATIBLE: