xref: /Universal-ctags/Units/parser-cxx.r/templates-in-labmdas-1.cpp.d/input.cpp (revision 2b4195594c3f8eb558503439f8b13113d5d2456f)
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()14 int f1()
15 {
16     Bar<int> b;
17     auto t = b.template foo<int>();
18     return t;
19 }
20 
f2()21 int f2()
22 {
23     Bar<int> b;
24     auto l = [](auto & p){ return p.template foo<int>();};
25     return l(b);
26 }
27 
main()28 int main()
29 {
30     return f1() + f2();
31 }
32