aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2009-11-20 16:03:19 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2009-11-20 16:03:19 +0000
commit10d3a72a808a1daa4a98a8be95a858a0aa053f3f (patch)
treeb6896c489486ee405d8bf7bfc865dcd647f9b344 /gcc/cp
parent2848dbd32c6ba366aa4ea9fb7f47de093ddb507e (diff)
downloadgcc-10d3a72a808a1daa4a98a8be95a858a0aa053f3f.zip
gcc-10d3a72a808a1daa4a98a8be95a858a0aa053f3f.tar.gz
gcc-10d3a72a808a1daa4a98a8be95a858a0aa053f3f.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/except.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b5b2b04..a4024ef 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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>
PR c++/29017
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 1b13819..66dc14e 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -752,8 +752,12 @@ build_throw (tree exp)
}
}
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
the space first we would have to deal with cleaning it up if