Commit e3edeff4 by Jason Merrill Committed by Jason Merrill

re PR c++/48873 ([C++0x][noexcept] Placement-new problem with deleted destructors)

	PR c++/48873
	* tree.c (stabilize_expr): Don't make gratuitous copies of classes.

From-SVN: r173433
parent 532388e2
2011-05-05 Jason Merrill <jason@redhat.com>
PR c++/48873
* tree.c (stabilize_expr): Don't make gratuitous copies of classes.
2011-05-05 Eric Botcazou <ebotcazou@adacore.com> 2011-05-05 Eric Botcazou <ebotcazou@adacore.com>
* decl.c (start_preparsed_function): Do not set * decl.c (start_preparsed_function): Do not set
......
...@@ -3119,7 +3119,10 @@ stabilize_expr (tree exp, tree* initp) ...@@ -3119,7 +3119,10 @@ stabilize_expr (tree exp, tree* initp)
if (!TREE_SIDE_EFFECTS (exp)) if (!TREE_SIDE_EFFECTS (exp))
init_expr = NULL_TREE; init_expr = NULL_TREE;
else if (!TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (exp)) /* There are no expressions with REFERENCE_TYPE, but there can be call
arguments with such a type; just treat it as a pointer. */
else if (TREE_CODE (TREE_TYPE (exp)) == REFERENCE_TYPE
|| SCALAR_TYPE_P (exp)
|| !lvalue_or_rvalue_with_address_p (exp)) || !lvalue_or_rvalue_with_address_p (exp))
{ {
init_expr = get_target_expr (exp); init_expr = get_target_expr (exp);
......
2011-05-05 Jason Merrill <jason@redhat.com>
* g++.dg/init/new32.C: New.
2011-05-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2011-05-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gfortran.dg/fmt_g0_6.f08: Use dg-options "-ffloat-store". * gfortran.dg/fmt_g0_6.f08: Use dg-options "-ffloat-store".
......
// PR c++/48873
#include <new>
struct D {
private:
~D();
};
template<class T>
T& create();
void f()
{
D* dp = new (((void*) 0)) D(create<D>()); // #
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment