1 // DR 1510, PR c++/60420
2 // { dg-do compile { target c++11 } }
3 
4 struct MyIter
5 {
6   int& operator*();
7 };
8 
foo(MyIter begin)9 void foo(MyIter begin)
10 {
11   auto x = [](const decltype(*begin)) { };
12 }
13 
14 template<typename Iterator>
bar(Iterator begin)15 void bar(Iterator begin)
16 {
17   auto x = [](const decltype(*begin)) { };
18 }
19 
20 template void bar<MyIter>(MyIter);
21