* cvt.c (cp_convert_to_pointer): Call force_fit_type for null
pointers.
From-SVN: r55272
2002-07-05 Jason Merrill <jason@redhat.com>
+ * cvt.c (cp_convert_to_pointer): Call force_fit_type for null
+ pointers.
+
PR optimization/7145
* tree.c (cp_copy_res_decl_for_inlining): Also copy DECL_INITIAL.
else
expr = build_int_2 (0, 0);
TREE_TYPE (expr) = type;
+ /* Fix up the representation of -1 if appropriate. */
+ force_fit_type (expr, 0);
return expr;
}
--- /dev/null
+// Bug: The double cast had an TREE_INT_CST_HIGH of 0, while the single
+// cast had -1, so the comparison failed.
+
+// { dg-do run }
+
+struct A { };
+
+typedef int A::* aip;
+typedef long A::* alp;
+
+int main()
+{
+ return ((aip)(alp)0 != (aip)0);
+}