On 10/09/2017 06:30 PM, Bernd Edlinger wrote:
+/* Heuristic check if two parameter types can be considered ABI-equivalent.  */
+
+static bool
+cxx_abi_equiv_type_p (tree t1, tree t2)

This name is too general for a function that is specifically for implementing a particular warning.

+  if (INTEGRAL_TYPE_P (t1)
+      && INTEGRAL_TYPE_P (t2)
+      && TYPE_PRECISION (t1) == TYPE_PRECISION (t2)
+      && (TYPE_UNSIGNED (t1) == TYPE_UNSIGNED (t2)
+         || TYPE_PRECISION (t1) >= TYPE_PRECISION (integer_type_node)))
+    return true;

This section needs a comment explaining what you're allowing and why.
+  else if (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype))
+    {
+      if ((complain & tf_warning)
+         && !same_type_p (type, intype))

Why not use cxx_safe_function_type_cast_p here, too? TYPE_PTRMEMFUNC_FN_TYPE will be helpful.

Jason

Reply via email to