The following definition of declarative region:
Every name is introduced in some portion of program text called a declarative region, which is the largest part of the program in which that name is valid, that is, in which that name may be used as an unqualified name to refer to the same entity.
We have example into the spec below:
int j = 24;
int main() {
int i = j, j;
j = 42;
}
the identifier j is declared twice as a name (and used twice). The declarative region of the first j includes the entire example. The potential scope of the first j begins immediately after that j and extends to the end of the program, but its (actual) scope excludes the text between the , and the }. The declarative region of the second declaration of j (the j immediately before the semicolon) includes all the text between { and }, but its potential scope excludes the declaration of i. The scope of the second declaration of j is the same as its potential scope.
It's unclear how to determine declarative region for arbitrary name. At least I can't find this into the standard.
The potential scope of a variable declared at the file scope (i.e., not inside a namespace, class, or function) is from the point at which the variable is declared until the end of file. The potential scope of a variable declared inside a function is from the point at which the variable is declared until the close brace inside of which the variable was declared.
The actual scope of a variable can be smaller than the potential scope if a new variable of the same name is declared at some inner scope. This is called shadowing.