| 1 |
inline auto l_auto = [] (auto) {}; |
| 2 |
|
| 3 |
inline auto l_tpl = [] <typename T> (T) {}; |
| 4 |
|
| 5 |
inline auto l_tpl_auto = [] <typename T> (T, auto) {}; |
| 6 |
|
| 7 |
inline auto l_tpl_nt_ary = [] <int I> (int (&)[I]) {}; |
| 8 |
|
| 9 |
inline auto l_tpl_nt_auto = [] <auto I = 0> () {}; |
| 10 |
|
| 11 |
template<typename T, unsigned I> class U; |
| 12 |
|
| 13 |
template<template<typename, unsigned> typename> class TPL {}; |
| 14 |
inline auto l_tpl_tpl = [] <template<typename, unsigned> typename T> (TPL<T> &) {}; |
| 15 |
|
| 16 |
template<template<template<typename, unsigned> typename> typename> class TPLTPL {}; |
| 17 |
inline auto l_tpl_tpl_tpl = []<template<template<typename, unsigned> typename> typename T> (TPLTPL<T> &) {}; |
| 18 |
|
| 19 |
inline auto l_var = []<typename... Args> (Args...) {}; |
| 20 |
|
| 21 |
#if FIXME // we fail to parse (&...) correctly |
| 22 |
inline auto l_var2 = []<int... I> (int (&...)[I]) {}; |
| 23 |
#endif |
| 24 |
|
| 25 |
template<int...I> class X {}; |
| 26 |
inline auto l_var3 = []<template<int...> typename T, int...I> (T<I...> &a) {}; |
| 27 |
|
| 28 |
template<template<typename, unsigned> typename...T> class Y{}; |
| 29 |
inline auto l_var4 = []<template<typename, unsigned> typename... T> (Y<T...> &a) {}; |
| 30 |
|
| 31 |
template<int I> inline void Fn () |
| 32 |
{ |
| 33 |
auto l = []<typename T> (T) {}; |
| 34 |
l (1); |
| 35 |
} |
| 36 |
|
| 37 |
void f () |
| 38 |
{ |
| 39 |
l_auto (1); |
| 40 |
l_tpl (1); |
| 41 |
l_tpl_auto (1, 1); |
| 42 |
int ary[2]; |
| 43 |
l_tpl_nt_ary (ary); |
| 44 |
l_tpl_nt_auto (); |
| 45 |
TPL<U> v; |
| 46 |
l_tpl_tpl (v); |
| 47 |
TPLTPL<TPL> u; |
| 48 |
l_tpl_tpl_tpl (u); |
| 49 |
l_var (1, 2, 3); |
| 50 |
#if FIXME |
| 51 |
l_var2 (ary, ary); |
| 52 |
#endif |
| 53 |
X<1,2,3> x; |
| 54 |
l_var3 (x); |
| 55 |
Y<U,U> y; |
| 56 |
l_var4 (y); |
| 57 |
|
| 58 |
Fn<1> (); |
| 59 |
|
| 60 |
auto l1 = []<typename T, T v = T(0)> (T a) { |
| 61 |
auto l2 = []<typename U> (T a, U b) {}; |
| 62 |
|
| 63 |
l2 (a, v); |
| 64 |
}; |
| 65 |
auto l3 = []<typename T>(U<T, 0> *, U<int, 0> *) {}; |
| 66 |
|
| 67 |
l1 (1); |
| 68 |
l1 ('1'); |
| 69 |
l3 ((U<char, 0> *)nullptr, nullptr); |
| 70 |
} |