+2005-04-25 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/21188
+ * rtti.c (ifnonnull): Cast the zero comparison operand
+ to the correct type.
+
2005-04-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/20991
ifnonnull (tree test, tree result)
{
return build3 (COND_EXPR, TREE_TYPE (result),
- build2 (EQ_EXPR, boolean_type_node, test, integer_zero_node),
+ build2 (EQ_EXPR, boolean_type_node, test,
+ cp_convert (TREE_TYPE (test), integer_zero_node)),
cp_convert (TREE_TYPE (result), integer_zero_node),
result);
}
+2005-04-25 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/21188
+ * g++.dg/opt/rtti2.C: New test.
+
2005-04-25 Paul Brook <paul@codesourcery.com>
Steven G. Kargl <kargls@comcast.net>
--- /dev/null
+// { dg-do compile }
+// { dg-options "-O2" }
+// We used to ICE in compare_values as the types for a comparison
+// were not the same kind of types.
+
+struct class1
+{
+ virtual ~class1 ();
+};
+struct class2 : class1 { };
+
+void f(class1 * oo)
+{
+ class2 * oj = dynamic_cast <class2 *>(oo) ;
+ if (oj)
+ delete oo;
+}