Cesium icon indicating copy to clipboard operation
Cesium copied to clipboard

Add some tests for static variables in nested blocks

Open ForNeVeR opened this issue 1 year ago • 0 comments

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.

ForNeVeR avatar May 21 '23 19:05 ForNeVeR