diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 1614f346a59f8..7c68706640c5b 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -4384,7 +4384,7 @@ bool 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); diff --git a/gcc/testsuite/g++.dg/cpp0x/dependent3.C b/gcc/testsuite/g++.dg/cpp0x/dependent3.C new file mode 100644 index 0000000000000..caf7e1cd4a49c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/dependent3.C @@ -0,0 +1,28 @@ +// { dg-do compile { target c++11 } } + +template +struct d +{ + using e = c; +}; + +template +struct g +{ + using h = typename d::e; + + template + auto operator()(i, j k) -> decltype(h{k}); +}; + +template +void m() +{ + int a[1]; + l{}(a, a); +} + +int main() +{ + m>(); +}