// cling problem with lambda functions inside of template functions
//
// A code fragment illustrating the problem is given below.
// Starting ROOT and running the macro once works, running it
// a second time produces a crash. Commenting the (not-even used)
// lambda function avoid the crash. The macro can be run as often as
// one likes.
//
// ROOT 6.20/02 on MacOSX 10.15.06
// root [1] .x crash.cc -> works
// root [2] .x crash.cc -> crash
template T square(T x) {
auto crash = [](double x) {return x;}; // comment this line to avoid the crash
return x*x;
}
void crash()
{
printf("%d\n",square(2));
}