Handle Block Scope inside If condition (Bug: 4624)

Hello Team,
Please review the change: https://reviews.llvm.org/D82266

Bug 46242 (Compiler error when using lambda inside if initializer)

Regards,
Nadaf.

Hello Team,
Reworked on comments and added a new test case. Please review https://reviews.llvm.org/D82266

Regards,
Nadaf.