1 // Bug reported by akrzyz on github. 2 3 template<class T> 4 class Bar 5 { 6 public: 7 template <class A> foo()8 A foo() 9 { 10 return A{}; 11 } 12 }; 13 f1()14int f1() 15 { 16 Bar<int> b; 17 auto t = b.template foo<int>(); 18 return t; 19 } 20 f2()21int f2() 22 { 23 Bar<int> b; 24 auto l = [](auto & p){ return p.template foo<int>();}; 25 return l(b); 26 } 27 main()28int main() 29 { 30 return f1() + f2(); 31 } 32