aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/tree.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr92524.C12
4 files changed, 28 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6cf8579..4cbdb43 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92524
+ * tree.c (replace_placeholders_r): Don't walk constructor elts with
+ RANGE_EXPR indexes.
+
2019-11-26 Jason Merrill <jason@redhat.com>
* pt.c (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Remember the
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 6c39c00..d125d60 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -3144,6 +3144,11 @@ replace_placeholders_r (tree* t, int* walk_subtrees, void* data_)
tree type = TREE_TYPE (*valp);
tree subob = obj;
+ /* Elements with RANGE_EXPR index shouldn't have any
+ placeholders in them. */
+ if (ce->index && TREE_CODE (ce->index) == RANGE_EXPR)
+ continue;
+
if (TREE_CODE (*valp) == CONSTRUCTOR
&& AGGREGATE_TYPE_P (type))
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index df74ba6..ab45591 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92524
+ * g++.dg/cpp0x/pr92524.C: New test.
+
2019-11-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/92645
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr92524.C b/gcc/testsuite/g++.dg/cpp0x/pr92524.C
new file mode 100644
index 0000000..ffbcd8f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr92524.C
@@ -0,0 +1,12 @@
+// PR c++/92524
+// { dg-do compile { target c++11 } }
+
+struct A { char a = '*'; };
+struct B { A b[64]; };
+
+void
+foo ()
+{
+ A a;
+ B{a};
+}