+2009-10-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/37204
+ * typeck.c (build_reinterpret_cast_1): Handle rvalue refs
+ properly.
+
2009-10-11 Richard Guenther <rguenther@suse.de>
* tree.c (cp_free_lang_data): Drop anonymous aggregate names.
intype, type);
expr = cp_build_unary_op (ADDR_EXPR, expr, 0, complain);
+
+ if (warn_strict_aliasing > 2)
+ strict_aliasing_warning (TREE_TYPE (expr), type, expr);
+
if (expr != error_mark_node)
expr = build_reinterpret_cast_1
(build_pointer_type (TREE_TYPE (type)), expr, c_cast_p,
valid_p, complain);
if (expr != error_mark_node)
- expr = cp_build_indirect_ref (expr, 0, complain);
+ /* cp_build_indirect_ref isn't right for rvalue refs. */
+ expr = convert_from_reference (fold_convert (type, expr));
return expr;
}