* tree.c (replace_placeholders_r): Use handled_component_p.
From-SVN: r259088
+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
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;
--- /dev/null
+// 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{};
+}