Commit 10d3a72a by Paolo Carlini Committed by Paolo Carlini

re PR c++/42060 ([c++0x] ICE throwing array with initializer list)

cp/
2009-11-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/42060
	* except.c (build_throw): Check the tree returned by
	decay_conversion for error_mark_node.

testsuite/
2009-11-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/42060
	* g++.dg/cpp0x/initlist28.C: New.

From-SVN: r154371
parent 2848dbd3
2009-11-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/42060
* except.c (build_throw): Check the tree returned by
decay_conversion for error_mark_node.
2009-11-20 Shujing Zhao <pearly.zhao@oracle.com> 2009-11-20 Shujing Zhao <pearly.zhao@oracle.com>
PR c++/29017 PR c++/29017
......
...@@ -752,8 +752,12 @@ build_throw (tree exp) ...@@ -752,8 +752,12 @@ build_throw (tree exp)
} }
} }
else else
exp = build2 (INIT_EXPR, temp_type, object, {
decay_conversion (exp)); tmp = decay_conversion (exp);
if (tmp == error_mark_node)
return error_mark_node;
exp = build2 (INIT_EXPR, temp_type, object, tmp);
}
/* Pre-evaluate the thrown expression first, since if we allocated /* Pre-evaluate the thrown expression first, since if we allocated
the space first we would have to deal with cleaning it up if the space first we would have to deal with cleaning it up if
......
2009-11-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/42060
* g++.dg/cpp0x/initlist28.C: New.
2009-11-20 H.J. Lu <hongjiu.lu@intel.com> 2009-11-20 H.J. Lu <hongjiu.lu@intel.com>
* gfortran.dg/proc_ptr_comp_23.f90: Add a missing space. * gfortran.dg/proc_ptr_comp_23.f90: Add a missing space.
......
// PR c++/42060
// { dg-options "-std=c++0x" }
void foo()
{
int a[1];
throw a = {}; // { dg-error "invalid use of non-lvalue array" }
}
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