Files
gcc-reflection/gcc/testsuite/g++.dg/cpp1y/lambda-generic-const3.C
Jason Merrill 8afd9c45b6 PR c++/79640 - infinite recursion with generic lambda.
* pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
	before substituting its initializer.

From-SVN: r246289
2017-03-20 14:49:10 -04:00

16 lines
210 B
C

// PR c++/79640
// { dg-do compile { target c++14 } }
template<typename F> void foo(F f)
{
f(1);
}
template<int> void bar()
{
const int i = i;
foo([] (auto) { sizeof(i); });
}
void baz() { bar<1>(); }