]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 10 May 2019 17:57:27 +0000 (17:57 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 10 May 2019 17:57:27 +0000 (17:57 +0000)
2019-05-10  Paolo Carlini  <paolo.carlini@oracle.com>

* call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
* cp-gimplify.c (cp_fold): Likewise.
* cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
* cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
* cvt.c (perform_qualification_conversions): Likewise.
* decl.c (grokdeclarator): Likewise.
* decl2.c (build_memfn_type): Likewise.
* mangle.c (canonicalize_for_substitution, write_type): Likewise.
* parser.c (cp_parser_omp_declare_reduction): Likewise.
* pt.c (check_explicit_specialization, uses_deducible_template_parms,
check_cv_quals_for_unify, dependent_type_p_r): Likewise.
* rtti.c (ptr_initializer): Likewise.
* semantics.c (finish_asm_stmt, finish_offsetof,
cp_check_omp_declare_reduction): Likewise.
* tree.c (cp_build_qualified_type_real,
cp_build_type_attribute_variant, cxx_type_hash_eq,
cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
* typeck.c (structural_comptypes, convert_arguments,
cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
Likewise.

From-SVN: r271069

15 files changed:
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-gimplify.c
gcc/cp/cp-objcp-common.c
gcc/cp/cp-tree.h
gcc/cp/cvt.c
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/mangle.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/rtti.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/cp/typeck.c

index a43001a1a111ad2ba143e94db23d0b6cfa25a3f3..4b245a2f6044b1be68dfa9fb8f9179634125b845 100644 (file)
@@ -1,3 +1,27 @@
+2019-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
+       * cp-gimplify.c (cp_fold): Likewise.
+       * cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
+       * cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
+       * cvt.c (perform_qualification_conversions): Likewise.
+       * decl.c (grokdeclarator): Likewise.
+       * decl2.c (build_memfn_type): Likewise.
+       * mangle.c (canonicalize_for_substitution, write_type): Likewise.
+       * parser.c (cp_parser_omp_declare_reduction): Likewise.
+       * pt.c (check_explicit_specialization, uses_deducible_template_parms,
+       check_cv_quals_for_unify, dependent_type_p_r): Likewise.
+       * rtti.c (ptr_initializer): Likewise.
+       * semantics.c (finish_asm_stmt, finish_offsetof,
+       cp_check_omp_declare_reduction): Likewise.
+       * tree.c (cp_build_qualified_type_real,
+       cp_build_type_attribute_variant, cxx_type_hash_eq,
+       cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
+       * typeck.c (structural_comptypes, convert_arguments,
+       cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
+       cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
+       Likewise.
+
 2019-05-10  Marek Polacek  <polacek@redhat.com>
 
        PR c++/78010 - bogus -Wsuggest-override warning on final function.
index 20db2974b56bbc21b819bbba305f9fabb8304c66..2329c4cb43e74620a1724a42aec787a787282d2a 100644 (file)
@@ -357,8 +357,7 @@ build_call_a (tree function, int n, tree *argarray)
 
   gcc_assert (TYPE_PTR_P (TREE_TYPE (function)));
   fntype = TREE_TYPE (TREE_TYPE (function));
-  gcc_assert (TREE_CODE (fntype) == FUNCTION_TYPE
-             || TREE_CODE (fntype) == METHOD_TYPE);
+  gcc_assert (FUNC_OR_METHOD_TYPE_P (fntype));
   result_type = TREE_TYPE (fntype);
   /* An rvalue has no cv-qualifiers.  */
   if (SCALAR_TYPE_P (result_type) || VOID_TYPE_P (result_type))
index 26be1fd15223eb14e5bb8dfd08a3cc1e3595f908..7a243addb9282c4e598eb8c67c904d42a3010ff3 100644 (file)
@@ -2324,8 +2324,7 @@ cp_fold (tree x)
 
       /* Cope with user tricks that amount to offsetof.  */
       if (op0 != error_mark_node
-         && TREE_CODE (TREE_TYPE (op0)) != FUNCTION_TYPE
-         && TREE_CODE (TREE_TYPE (op0)) != METHOD_TYPE)
+         && !FUNC_OR_METHOD_TYPE_P (TREE_TYPE (op0)))
        {
          tree val = get_base_address (op0);
          if (val
index bfd3fa6bf8d6b0a1807a419a4c924a7d0e1a0cd9..a8f7db0854a94e8993e91c076e30a524e5aac677 100644 (file)
@@ -248,16 +248,14 @@ cp_type_dwarf_attribute (const_tree type, int attr)
   switch (attr)
     {
     case DW_AT_reference:
-      if ((TREE_CODE (type) == FUNCTION_TYPE
-          || TREE_CODE (type) == METHOD_TYPE)
+      if (FUNC_OR_METHOD_TYPE_P (type)
          && FUNCTION_REF_QUALIFIED (type)
          && !FUNCTION_RVALUE_QUALIFIED (type))
        return 1;
       break;
 
     case DW_AT_rvalue_reference:
-      if ((TREE_CODE (type) == FUNCTION_TYPE
-          || TREE_CODE (type) == METHOD_TYPE)
+      if (FUNC_OR_METHOD_TYPE_P (type)
          && FUNCTION_REF_QUALIFIED (type)
          && FUNCTION_RVALUE_QUALIFIED (type))
        return 1;
index f253857b02afedf859c9f669509c6c908e86f53c..7fb25a93e441567f197197ec8e2f938caf91463e 100644 (file)
@@ -4342,8 +4342,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
 #define TYPE_OBJ_P(NODE)                       \
   (!TYPE_REF_P (NODE)                          \
    && !VOID_TYPE_P (NODE)                      \
-   && TREE_CODE (NODE) != FUNCTION_TYPE                \
-   && TREE_CODE (NODE) != METHOD_TYPE)
+   && !FUNC_OR_METHOD_TYPE_P (NODE))
 
 /* Returns true if NODE is a pointer to an object.  Keep these checks
    in ascending tree code order.  */
@@ -4359,8 +4358,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
    void.  Keep these checks in ascending tree code order.  */
 #define TYPE_PTROBV_P(NODE)                                    \
   (TYPE_PTR_P (NODE)                                           \
-   && !(TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE          \
-       || TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE))
+   && !FUNC_OR_METHOD_TYPE_P (TREE_TYPE (NODE)))
 
 /* Returns true if NODE is a pointer to function type.  */
 #define TYPE_PTRFN_P(NODE)                             \
index 3b8656c2a6b48c073fb64e98067f7676b910e2ff..b63a9ff6e982db7d4c2cdb97c7f27fb2229e77ed 100644 (file)
@@ -1996,8 +1996,7 @@ perform_qualification_conversions (tree type, tree expr)
 bool
 tx_safe_fn_type_p (tree t)
 {
-  if (TREE_CODE (t) != FUNCTION_TYPE
-      && TREE_CODE (t) != METHOD_TYPE)
+  if (!FUNC_OR_METHOD_TYPE_P (t))
     return false;
   return !!lookup_attribute ("transaction_safe", TYPE_ATTRIBUTES (t));
 }
index 36014dc628eddb5b78e89da1fa6b32dc64fe94a7..300c2dbbbb1610266e76f38b171a50743922fb34 100644 (file)
@@ -11840,8 +11840,7 @@ grokdeclarator (const cp_declarator *declarator,
     }
 
   if (unqualified_id && TREE_CODE (unqualified_id) == TEMPLATE_ID_EXPR
-      && TREE_CODE (type) != FUNCTION_TYPE
-      && TREE_CODE (type) != METHOD_TYPE
+      && !FUNC_OR_METHOD_TYPE_P (type)
       && !variable_template_p (TREE_OPERAND (unqualified_id, 0)))
     {
       error ("template-id %qD used as a declarator",
@@ -12003,8 +12002,7 @@ grokdeclarator (const cp_declarator *declarator,
                    name);
          storage_class = sc_none;
        }
-      else if (TREE_CODE (type) == FUNCTION_TYPE
-              || TREE_CODE (type) == METHOD_TYPE)
+      else if (FUNC_OR_METHOD_TYPE_P (type))
        {
          error_at (sloc, "function %qs cannot be declared %<mutable%>",
                    name);
@@ -12694,8 +12692,7 @@ grokdeclarator (const cp_declarator *declarator,
                            declspecs->locations);
          }
       }
-    else if (TREE_CODE (type) == FUNCTION_TYPE
-            || TREE_CODE (type) == METHOD_TYPE)
+    else if (FUNC_OR_METHOD_TYPE_P (type))
       {
        tree original_name;
        int publicp = 0;
index 6f23ee1cd3fe853a13840f3b68ca11f823b4f86e..fb3b911fdd5fd03109220c05aa76302a5232bb10 100644 (file)
@@ -158,8 +158,7 @@ build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals,
   if (fntype == error_mark_node || ctype == error_mark_node)
     return error_mark_node;
 
-  gcc_assert (TREE_CODE (fntype) == FUNCTION_TYPE
-             || TREE_CODE (fntype) == METHOD_TYPE);
+  gcc_assert (FUNC_OR_METHOD_TYPE_P (fntype));
 
   cp_cv_quals type_quals = quals & ~TYPE_QUAL_RESTRICT;
   ctype = cp_build_qualified_type (ctype, type_quals);
index 4b2212349d68ed3df861ea2f5459e943e4e25843..c13dacbd05e622739ce213a5453088bb66d05821 100644 (file)
@@ -414,8 +414,7 @@ canonicalize_for_substitution (tree node)
       else
        node = cp_build_qualified_type (TYPE_MAIN_VARIANT (node),
                                        cp_type_quals (node));
-      if (TREE_CODE (node) == FUNCTION_TYPE
-         || TREE_CODE (node) == METHOD_TYPE)
+      if (FUNC_OR_METHOD_TYPE_P (node))
        {
          node = build_ref_qualified_type (node, type_memfn_rqual (orig));
          tree r = canonical_eh_spec (TYPE_RAISES_EXCEPTIONS (orig));
@@ -2070,8 +2069,7 @@ write_type (tree type)
          t = cp_build_type_attribute_variant (t, attrs);
        }
       gcc_assert (t != type);
-      if (TREE_CODE (t) == FUNCTION_TYPE
-         || TREE_CODE (t) == METHOD_TYPE)
+      if (FUNC_OR_METHOD_TYPE_P (t))
        {
          t = build_ref_qualified_type (t, type_memfn_rqual (type));
          if (flag_noexcept_type)
@@ -2102,8 +2100,7 @@ write_type (tree type)
 
       /* See through any typedefs.  */
       type = TYPE_MAIN_VARIANT (type);
-      if (TREE_CODE (type) == FUNCTION_TYPE
-         || TREE_CODE (type) == METHOD_TYPE)
+      if (FUNC_OR_METHOD_TYPE_P (type))
        type = cxx_copy_lang_qualifiers (type, type_orig);
 
       /* According to the C++ ABI, some library classes are passed the
index 12beadf5096db0190cf152b90cfb6799aba0adf1..5881d932fba1cdec8737f0a5e340d65d716e5c25 100644 (file)
@@ -39646,8 +39646,7 @@ cp_parser_omp_declare_reduction (cp_parser *parser, cp_token *pragma_tok,
                           || id_equal (orig_reduc_id, "max")))))
        error_at (loc, "predeclared arithmetic type %qT in "
                       "%<#pragma omp declare reduction%>", type);
-      else if (TREE_CODE (type) == FUNCTION_TYPE
-              || TREE_CODE (type) == METHOD_TYPE
+      else if (FUNC_OR_METHOD_TYPE_P (type)
               || TREE_CODE (type) == ARRAY_TYPE)
        error_at (loc, "function or array type %qT in "
                       "%<#pragma omp declare reduction%>", type);
index d6976e08690452da9b48cc5ce9f53271bf59ffaa..08da94ae0c9cd5ebb716a804e8b0a632d66a9dc0 100644 (file)
@@ -2906,8 +2906,7 @@ check_explicit_specialization (tree declarator,
 
   if ((specialization || member_specialization)
       /* This doesn't apply to variable templates.  */
-      && (TREE_CODE (TREE_TYPE (decl)) == FUNCTION_TYPE
-          || TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE))
+      && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (decl)))
     {
       tree t = TYPE_ARG_TYPES (TREE_TYPE (decl));
       for (; t; t = TREE_CHAIN (t))
@@ -20667,8 +20666,7 @@ uses_deducible_template_parms (tree type)
   /* type (T)
      T()
      T(T)  */
-  if (TREE_CODE (type) == FUNCTION_TYPE
-      || TREE_CODE (type) == METHOD_TYPE)
+  if (FUNC_OR_METHOD_TYPE_P (type))
     {
       if (uses_deducible_template_parms (TREE_TYPE (type)))
        return true;
@@ -21646,8 +21644,7 @@ check_cv_quals_for_unify (int strict, tree arg, tree parm)
          It is ok when we're allowing additional CV qualifiers
          at the outer level [14.8.2.1]/3,1st bullet.  */
       if ((TYPE_REF_P (arg)
-          || TREE_CODE (arg) == FUNCTION_TYPE
-          || TREE_CODE (arg) == METHOD_TYPE)
+          || FUNC_OR_METHOD_TYPE_P (arg))
          && (parm_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)))
        return 0;
 
@@ -25290,8 +25287,7 @@ dependent_type_p_r (tree type)
                                           (type)));
   else if (INDIRECT_TYPE_P (type))
     return dependent_type_p (TREE_TYPE (type));
-  else if (TREE_CODE (type) == FUNCTION_TYPE
-          || TREE_CODE (type) == METHOD_TYPE)
+  else if (FUNC_OR_METHOD_TYPE_P (type))
     {
       tree arg_type;
 
index 3ca2b5e7b886fd60dd33aa9e8c8f5ae3ba264ae3..26dae3c3c1a18b73c02d0125a602758a07d2c655 100644 (file)
@@ -1015,8 +1015,7 @@ ptr_initializer (tinfo_s *ti, tree target)
       to = tx_unsafe_fn_variant (to);
     }
   if (flag_noexcept_type
-      && (TREE_CODE (to) == FUNCTION_TYPE
-         || TREE_CODE (to) == METHOD_TYPE)
+      && FUNC_OR_METHOD_TYPE_P (to)
       && TYPE_NOTHROW_P (to))
     {
       flags |= 0x40;
index 93bd8fb8a1761b913a6e789e2eebbee03e01b9ef..1093cbef1346d63d6284e2412dede9ad93d7b2b4 100644 (file)
@@ -1527,8 +1527,7 @@ finish_asm_stmt (int volatile_p, tree string, tree output_operands,
                  || CP_TYPE_CONST_P (TREE_TYPE (operand))
                  /* Functions are not modifiable, even though they are
                     lvalues.  */
-                 || TREE_CODE (TREE_TYPE (operand)) == FUNCTION_TYPE
-                 || TREE_CODE (TREE_TYPE (operand)) == METHOD_TYPE
+                 || FUNC_OR_METHOD_TYPE_P (TREE_TYPE (operand))
                  /* If it's an aggregate and any field is const, then it is
                     effectively const.  */
                  || (CLASS_TYPE_P (TREE_TYPE (operand))
@@ -4141,8 +4140,7 @@ finish_offsetof (tree object_ptr, tree expr, location_t loc)
              TREE_OPERAND (expr, 2));
       return error_mark_node;
     }
-  if (TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE
-      || TREE_CODE (TREE_TYPE (expr)) == METHOD_TYPE
+  if (FUNC_OR_METHOD_TYPE_P (TREE_TYPE (expr))
       || TREE_TYPE (expr) == unknown_type_node)
     {
       while (TREE_CODE (expr) == COMPONENT_REF
@@ -5538,8 +5536,7 @@ cp_check_omp_declare_reduction (tree udr)
          return;
        }
     }
-  else if (TREE_CODE (type) == FUNCTION_TYPE
-          || TREE_CODE (type) == METHOD_TYPE
+  else if (FUNC_OR_METHOD_TYPE_P (type)
           || TREE_CODE (type) == ARRAY_TYPE)
     {
       error_at (loc, "function or array type %qT in "
index 718eed349c65f7eb78972dade3ebf7467ecb8719..ebc6cb6278dc485bf32ed2d6c8645e2c86f3600f 100644 (file)
@@ -1308,8 +1308,7 @@ cp_build_qualified_type_real (tree type,
      (in CD1) we always ignore extra cv-quals on functions.  */
   if (type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)
       && (TYPE_REF_P (type)
-         || TREE_CODE (type) == FUNCTION_TYPE
-         || TREE_CODE (type) == METHOD_TYPE))
+         || FUNC_OR_METHOD_TYPE_P (type)))
     {
       if (TYPE_REF_P (type))
        bad_quals |= type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
@@ -4725,8 +4724,7 @@ cp_build_type_attribute_variant (tree type, tree attributes)
   tree new_type;
 
   new_type = build_type_attribute_variant (type, attributes);
-  if (TREE_CODE (new_type) == FUNCTION_TYPE
-      || TREE_CODE (new_type) == METHOD_TYPE)
+  if (FUNC_OR_METHOD_TYPE_P (new_type))
     gcc_checking_assert (cxx_type_hash_eq (type, new_type));
 
   /* Making a new main variant of a class type is broken.  */
@@ -4741,8 +4739,7 @@ cp_build_type_attribute_variant (tree type, tree attributes)
 bool
 cxx_type_hash_eq (const_tree typea, const_tree typeb)
 {
-  gcc_assert (TREE_CODE (typea) == FUNCTION_TYPE
-             || TREE_CODE (typea) == METHOD_TYPE);
+  gcc_assert (FUNC_OR_METHOD_TYPE_P (typea));
 
   if (type_memfn_rqual (typea) != type_memfn_rqual (typeb))
     return false;
@@ -4759,7 +4756,7 @@ tree
 cxx_copy_lang_qualifiers (const_tree typea, const_tree typeb)
 {
   tree type = CONST_CAST_TREE (typea);
-  if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE)
+  if (FUNC_OR_METHOD_TYPE_P (type))
     type = build_cp_fntype_variant (type, type_memfn_rqual (typeb),
                                    TYPE_RAISES_EXCEPTIONS (typeb),
                                    TYPE_HAS_LATE_RETURN_TYPE (typeb));
@@ -5371,8 +5368,7 @@ cp_fix_function_decl_p (tree decl)
 void
 cp_free_lang_data (tree t)
 {
-  if (TREE_CODE (t) == METHOD_TYPE
-      || TREE_CODE (t) == FUNCTION_TYPE)
+  if (FUNC_OR_METHOD_TYPE_P (t))
     {
       /* Default args are not interesting anymore.  */
       tree argtypes = TYPE_ARG_TYPES (t);
index 06f485a136b186069aeeb9630f966748a08a55f2..fff45cc7d804d471a02b0486ea661e4b9def3be1 100644 (file)
@@ -1262,8 +1262,7 @@ structural_comptypes (tree t1, tree t2, int strict)
     return false;
   /* Need to check this before TYPE_MAIN_VARIANT.
      FIXME function qualifiers should really change the main variant.  */
-  if (TREE_CODE (t1) == FUNCTION_TYPE
-      || TREE_CODE (t1) == METHOD_TYPE)
+  if (FUNC_OR_METHOD_TYPE_P (t1))
     {
       if (type_memfn_rqual (t1) != type_memfn_rqual (t2))
        return false;
@@ -4037,8 +4036,7 @@ convert_arguments (tree typelist, vec<tree, va_gc> **values, tree fndecl,
       if (type == 0 || !TYPE_REF_P (type))
        {
          if (TREE_CODE (TREE_TYPE (val)) == ARRAY_TYPE
-             || TREE_CODE (TREE_TYPE (val)) == FUNCTION_TYPE
-             || TREE_CODE (TREE_TYPE (val)) == METHOD_TYPE)
+             || FUNC_OR_METHOD_TYPE_P (TREE_TYPE (val)))
            val = decay_conversion (val, complain);
        }
 
@@ -6022,8 +6020,7 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain)
 
   /* Anything not already handled and not a true memory reference
      is an error.  */
-  if (TREE_CODE (argtype) != FUNCTION_TYPE
-      && TREE_CODE (argtype) != METHOD_TYPE)
+  if (!FUNC_OR_METHOD_TYPE_P (argtype))
     {
       cp_lvalue_kind kind = lvalue_kind (arg);
       if (kind == clk_none)
@@ -6600,8 +6597,7 @@ unary_complex_lvalue (enum tree_code code, tree arg)
       return arg;
     }
 
-  if (TREE_CODE (TREE_TYPE (arg)) == FUNCTION_TYPE
-      || TREE_CODE (TREE_TYPE (arg)) == METHOD_TYPE
+  if (FUNC_OR_METHOD_TYPE_P (TREE_TYPE (arg))
       || TREE_CODE (arg) == OFFSET_REF)
     return NULL_TREE;
 
@@ -7974,8 +7970,7 @@ cp_build_c_cast (tree type, tree expr, tsubst_flags_t complain)
        }
     }
 
-  if (TREE_CODE (type) == FUNCTION_TYPE
-      || TREE_CODE (type) == METHOD_TYPE)
+  if (FUNC_OR_METHOD_TYPE_P (type))
     {
       if (complain & tf_error)
         error ("invalid cast to function type %qT", type);
@@ -8328,8 +8323,7 @@ cp_build_modify_expr (location_t loc, tree lhs, enum tree_code modifycode,
       && (TREE_READONLY (lhs) || CP_TYPE_CONST_P (lhstype)
          /* Functions are not modifiable, even though they are
             lvalues.  */
-         || TREE_CODE (TREE_TYPE (lhs)) == FUNCTION_TYPE
-         || TREE_CODE (TREE_TYPE (lhs)) == METHOD_TYPE
+         || FUNC_OR_METHOD_TYPE_P (TREE_TYPE (lhs))
          /* If it's an aggregate and any field is const, then it is
             effectively const.  */
          || (CLASS_TYPE_P (lhstype)
@@ -9852,7 +9846,7 @@ comp_ptr_ttypes_real (tree to, tree from, int constp)
 
       /* Const and volatile mean something different for function types,
         so the usual checks are not appropriate.  */
-      if (TREE_CODE (to) != FUNCTION_TYPE && TREE_CODE (to) != METHOD_TYPE)
+      if (!FUNC_OR_METHOD_TYPE_P (to))
        {
          if (!at_least_as_qualified_p (to, from))
            return 0;
@@ -10028,8 +10022,7 @@ cp_type_quals (const_tree type)
 cp_ref_qualifier
 type_memfn_rqual (const_tree type)
 {
-  gcc_assert (TREE_CODE (type) == FUNCTION_TYPE
-              || TREE_CODE (type) == METHOD_TYPE);
+  gcc_assert (FUNC_OR_METHOD_TYPE_P (type));
 
   if (!FUNCTION_REF_QUALIFIED (type))
     return REF_QUAL_NONE;