This fixes an ICE coming from mangle.c:write_expression when building the
testsuite of range-v3; the added testcase is a reduced reproducer for the ICE.
gcc/cp/ChangeLog:
* tree.c (zero_init_expr_p): Use uses_template_parms instead of
dependent_type_p.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/dependent3.C: New test.
2020-04-23 Patrick Palka <ppalka@redhat.com>
+ * tree.c (zero_init_expr_p): Use uses_template_parms instead of
+ dependent_type_p.
+
PR c++/94645
* pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
friend declaration rather than into its CP_DECL_CONTEXT.
zero_init_expr_p (tree t)
{
tree type = TREE_TYPE (t);
- if (!type || dependent_type_p (type))
+ if (!type || uses_template_parms (type))
return false;
if (zero_init_p (type))
return initializer_zerop (t);
2020-04-23 Patrick Palka <ppalka@redhat.com>
+ * g++.dg/cpp0x/dependent3.C: New test.
+
PR c++/94645
* g++.dg/cpp2a/concepts-lambda6.C: New test.
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+template<typename c>
+struct d
+{
+ using e = c;
+};
+
+template<class f>
+struct g
+{
+ using h = typename d<f>::e;
+
+ template<class i, class j>
+ auto operator()(i, j k) -> decltype(h{k});
+};
+
+template<class l>
+void m()
+{
+ int a[1];
+ l{}(a, a);
+}
+
+int main()
+{
+ m<g<int *>>();
+}