Commit 239209c4 by Jason Merrill Committed by Jason Merrill

PR c++/85148 - ICE with 'this' in array NSDMI.

	* tree.c (replace_placeholders_r): Use handled_component_p.

From-SVN: r259088
parent 1229c56c
2018-04-04 Jason Merrill <jason@redhat.com>
PR c++/85148 - ICE with 'this' in array NSDMI.
* tree.c (replace_placeholders_r): Use handled_component_p.
2018-04-04 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/65923
......
......@@ -3145,7 +3145,7 @@ replace_placeholders_r (tree* t, int* walk_subtrees, void* data_)
for (; !same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (*t),
TREE_TYPE (x));
x = TREE_OPERAND (x, 0))
gcc_assert (TREE_CODE (x) == COMPONENT_REF);
gcc_assert (handled_component_p (x));
*t = unshare_expr (x);
*walk_subtrees = false;
d->seen = true;
......
// PR c++/85148
// { dg-do compile { target c++14 } }
template<typename T> struct A
{
T x[1]{(__PTRDIFF_TYPE__)this};
};
void foo()
{
A<A<__PTRDIFF_TYPE__>> 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