gcc/cp/ChangeLog:
PR c++/95678
* tree.c (zero_init_expr_p): Use uses_template_parms instead of
dependent_type_p.
gcc/testsuite/ChangeLog:
PR c++/95678
* g++.dg/cpp0x/dependent3.C: New test.
(cherry picked from commit
9a453da5cac7b6610cd342a7bea256acba5e61e1)
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);
--- /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 *>>();
+}