which class represent variable scope ?

For example:

void func() {
unsigned a;
unsigned b;

I want to know whether a and b is in the same code scope. DeclContext does NOT work on this, which means a and b have the same DeclContext (a function decl context). I googled and found someone have already asked this question but didn’t get an answer.


Scope is not recorded directly in the AST. It would be both possible and reasonable to provide an API that recomputes the language-specific notion of the scope of each declaration in a function.