fix Issue 8609 - A forward reference error with static arrays
fix Issue 6312 - template instance cannot use argument from enclosing template
Merge pull request #1850 from 9rnsr/fix6312

Issue 6312 - template instance cannot use argument from enclosing template
Merge pull request #1849 from 9rnsr/fix8609

Issue 8609 - A forward reference error with static arrays