Index: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp +++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp @@ -2233,7 +2233,7 @@ EnterExpressionEvaluationContext EvalContext(*this, Sema::PotentiallyEvaluated); - LocalInstantiationScope Scope(*this); + LocalInstantiationScope Scope(*this, true); // Instantiate the initializer. ActOnStartCXXInClassMemberInitializer(); Index: cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp =================================================================== --- cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp +++ cfe/trunk/test/SemaTemplate/instantiate-local-class.cpp @@ -194,3 +194,22 @@ void f() { F(); } }; } + +namespace PR23194 { + struct X { + int operator()() const { return 0; } + }; + struct Y { + Y(int) {} + }; + template int make_seed_pair() noexcept { + struct state_t { + X x; + Y y{x()}; + }; + return 0; + } + int func() { + return make_seed_pair(); + } +}