1 // RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s
3 // expected-no-diagnostics
5 // Check recursive instantiation of lambda does not cause assertion.
6 // lambda function `f` in `fun1` is instantiated twice: first
7 // as f(f, Number<1>), then as f(f, Number<0>). The
8 // LocalInstantiationScopes of these two instantiations both contain
9 // `f` and `i`. However, since they are not merged, clang should not
15 static constexpr unsigned value
= v
;
18 template <unsigned IBegin
= 0,
20 constexpr auto fun1(Number
<IBegin
> = Number
<0>{}, Number
<IEnd
> = Number
<1>{})
22 constexpr unsigned a
= 0;
23 auto f
= [&](auto fs
, auto i
) {
24 if constexpr(i
.value
> 0)
27 return fs(fs
, Number
<IBegin
>{});
32 return f(f
, Number
<IEnd
>{});