[Refactoring] Reduce unnecessary symtab generation
fix Issue 12231 - ICE on the class declaration within lambda inside template constraint