A lambda in a function template may be recursively instantiated as the following example:
```
template <unsigned v>
struct Number
{
static constexpr unsigned value = v;
};
template <unsigned IBegin = 0,
unsigned IEnd = 1>
constexpr auto fun1(Number<IBegin> = Number<0>{}, Number<IEnd> = Number<1>{})
{
auto f = [&](auto fs, auto i) {
if constexpr(i.value > 0)
{
return fs(fs, Number<IBegin>{});
}
};
return f(f, Number<IEnd>{});
}
void fun2() {
fun1();
}
```
The recursive lambda will cause a bunch of lambda's instantiated, one inside another.
For each instantiation, clang asserts any formal arguments do not show up as formal
arguments of its outer instantiation. If these instantiations are not originated from the
same lambda, this is true. Unfortunately this is not true for recursive lambda's.