Cesium
Cesium copied to clipboard
Add some tests for static variables in nested blocks
After #397, adding a variable in a block is handled by BlockScope::AddVariable
. It handles static
variables specifically: by passing them to the parent.
We'll need to add (and probably fix) some tests for that. For example, consider this snippet:
void foo() {
{ // scope 1
static int x = 1;
}
{ // scope 2
static int x = 2;
}
}
Is this valid? (Perhaps.) Does this work in Cesium? Does this work correctly?
While we are at it, terminate TODO[#410]
in the corresponding code.