+2003-06-26 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11332
+ * typeck.c (build_static_cast): Avoid returning expressions with
+ reference type.
+
2003-06-26 Nathan Sidwell <nathan@codesourcery.com>
* call.c (build_op_delete_call): Use strip_array_call. Correct
t. */
result = perform_direct_initialization_if_possible (type, expr);
if (result)
- return result;
+ return convert_from_reference (result);
/* [expr.static.cast]
/* Convert from B* to D*. */
expr = build_base_path (MINUS_EXPR, build_address (expr),
base, /*nonnull=*/false);
- /* Convert the pointer to a reference. */
- return build_nop (type, expr);
+ /* Convert the pointer to a reference -- but then remember that
+ there are no expressions with reference type in C++. */
+ return convert_from_reference (build_nop (type, expr));
}
/* [expr.static.cast]
+2003-06-26 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11332
+ * g++.dg/expr/static_cast2.C: New test.
+
2003-06-26 Roger Sayle <roger@eyesopen.com>
Jakub Jelinek <jakub@redhat.com>