Where APawn::SetupPlayerInputComponent called?

I cant find out where this function is called from. I checked out Possess(pawn) function (somewhere in comments it was said i should look at this one) in APlayerController and AController but there’s no mention about SetupPlayerInputComponent. So where should I search for that function call?

It is being called in void APawn::PawnClientRestart()

Thanks a lot.

I looked through the code but I still cant get the idea. How PawnClientRestart is linked with possession? Some clarifications on this would be greatly appreciated)

I think you might want to post a separate question about that.

A PlayerController can possess a pawn by calling PlayerController::Possess. If auto possess is on, that happens in APawn::PreInitializeComponents