summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-03-29 11:55:01 -0400
committerJason Merrill <jason@gcc.gnu.org>2012-03-29 11:55:01 -0400
commit05262294638a469609ff17db4b200b2263103804 (patch)
tree307890a05164c0fa0f78bd3e5e0ee2e94a3bfa94
parent3cb04a531740217d12221a05fd3c8bacda656dae (diff)
downloadgcc-05262294638a469609ff17db4b200b2263103804.tar.gz
re PR c++/52685 (ICE in copy_binfo)
PR c++/52685 * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P. From-SVN: r185968
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/tree.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/inherit8.C13
4 files changed, 24 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4f9bae85c52..af7fa2dbe78 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/52685
+ * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
+
2012-03-29 Jakub Jelinek <jakub@redhat.com>
PR c++/52759
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 87e9be84ecc..30ad5e1b7be 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1237,12 +1237,11 @@ copy_binfo (tree binfo, tree type, tree t, tree *igo_prev, int virt)
TREE_CHAIN (*igo_prev) = new_binfo;
*igo_prev = new_binfo;
- if (binfo)
+ if (binfo && !BINFO_DEPENDENT_BASE_P (binfo))
{
int ix;
tree base_binfo;
- gcc_assert (!BINFO_DEPENDENT_BASE_P (binfo));
gcc_assert (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), type));
BINFO_OFFSET (new_binfo) = BINFO_OFFSET (binfo);
@@ -1255,8 +1254,6 @@ copy_binfo (tree binfo, tree type, tree t, tree *igo_prev, int virt)
for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++)
{
tree new_base_binfo;
-
- gcc_assert (!BINFO_DEPENDENT_BASE_P (base_binfo));
new_base_binfo = copy_binfo (base_binfo, BINFO_TYPE (base_binfo),
t, igo_prev,
BINFO_VIRTUAL_P (base_binfo));
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 00ec7bb855f..d25b4d92ee8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/52685
+ * g++.dg/template/inherit8.C: New.
+
2012-03-29 Jakub Jelinek <jakub@redhat.com>
PR c++/52759
diff --git a/gcc/testsuite/g++.dg/template/inherit8.C b/gcc/testsuite/g++.dg/template/inherit8.C
new file mode 100644
index 00000000000..a9b2bdb5601
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/inherit8.C
@@ -0,0 +1,13 @@
+// PR c++/52685
+
+template <typename T>
+struct A
+{
+ template <typename U>
+ struct B : public A <B<U> >
+ {
+ struct C : public B<U>
+ {
+ };
+ };
+};