aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2011-04-29 22:03:40 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2011-04-29 22:03:40 +0000
commit48e5d11979af0dd03c54623faffddc5f0c3c1741 (patch)
tree4303b30e583abeff4c47262505046c90b9a0162a /gcc
parentb15c64ee1aafcb68df59ecc46bd2c799d7618160 (diff)
downloadgcc-48e5d11979af0dd03c54623faffddc5f0c3c1741.zip
gcc-48e5d11979af0dd03c54623faffddc5f0c3c1741.tar.gz
gcc-48e5d11979af0dd03c54623faffddc5f0c3c1741.tar.bz2
re PR c++/48606 (g++.dg/init/ctor9.C ICE: tree check: expected class 'type', have 'exceptional' (error_mark) with -fkeep-inline-functions)
/cp 2011-04-29 Paolo Carlini <paolo.carlini@oracle.com> PR c++/48606 * init.c (perform_member_init): Check build_value_init return value for error_mark_node. /testsuite 2011-04-29 Paolo Carlini <paolo.carlini@oracle.com> PR c++/48606 * g++.dg/init/ctor10.C: New. From-SVN: r173194
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/init.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/init/ctor10.C9
4 files changed, 24 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7cd5eb6..55ba50b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/48606
+ * init.c (perform_member_init): Check build_value_init return
+ value for error_mark_node.
+
2011-04-29 Nicola Pero <nicola.pero@meta-innovation.com>,
Mike Stump <mikestump@comcast.net>
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 3f88857..d8b19c7 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -513,8 +513,10 @@ perform_member_init (tree member, tree init)
}
else
{
- init = build2 (INIT_EXPR, type, decl,
- build_value_init (type, tf_warning_or_error));
+ tree value = build_value_init (type, tf_warning_or_error);
+ if (value == error_mark_node)
+ return;
+ init = build2 (INIT_EXPR, type, decl, value);
finish_expr_stmt (init);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 42ea961..873e368 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/48606
+ * g++.dg/init/ctor10.C: New.
+
2011-04-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/48462
diff --git a/gcc/testsuite/g++.dg/init/ctor10.C b/gcc/testsuite/g++.dg/init/ctor10.C
new file mode 100644
index 0000000..91cc250
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/ctor10.C
@@ -0,0 +1,9 @@
+// PR c++/48606
+// { dg-do compile }
+// { dg-options "-fkeep-inline-functions" }
+
+struct S
+{
+ int &ref;
+ S() : ref() {}; // { dg-error "value-initialization of" }
+};