// PR c++/52014 // { dg-require-effective-target c++11 } template void for_each(const Iterator first, const Iterator last, Func func) { for (Iterator it = first; it != last; ++it) { func(*it); } } template struct helper { typedef typename T::size_type type; }; template struct helper { typedef typename T::size_type type; }; template struct helper { typedef typename T::size_type type; }; struct bar { struct foo { typedef int size_type; } foo_; void test() { int arr[] = { 1, 2, 3 }; for_each(arr, arr + 3, [&](helper::type i) { for_each(arr, arr + 3, [&](helper::type j) { }); }); } }; int main() { return 0; }