Commit 66143cdf by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/92524 (ICE in short program with constexpr and std::array)

	PR c++/92524
	* tree.c (replace_placeholders_r): Don't walk constructor elts with
	RANGE_EXPR indexes.

	* g++.dg/cpp0x/pr92524.C: New test.

From-SVN: r278759
parent 1fa715db
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> 2019-11-26 Jason Merrill <jason@redhat.com>
* pt.c (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Remember the * pt.c (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Remember the
......
...@@ -3144,6 +3144,11 @@ replace_placeholders_r (tree* t, int* walk_subtrees, void* data_) ...@@ -3144,6 +3144,11 @@ replace_placeholders_r (tree* t, int* walk_subtrees, void* data_)
tree type = TREE_TYPE (*valp); tree type = TREE_TYPE (*valp);
tree subob = obj; 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 if (TREE_CODE (*valp) == CONSTRUCTOR
&& AGGREGATE_TYPE_P (type)) && AGGREGATE_TYPE_P (type))
{ {
......
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> 2019-11-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/92645 PR tree-optimization/92645
......
// PR c++/92524
// { dg-do compile { target c++11 } }
struct A { char a = '*'; };
struct B { A b[64]; };
void
foo ()
{
A a;
B{a};
}
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