Fix a loophole with static local variables.

This commit is contained in:
David Anderson
2014-11-08 02:54:29 -08:00
parent 039572060e
commit 512cbc73a0
4 changed files with 8 additions and 2 deletions
@@ -5,6 +5,7 @@ public OnPluginStart()
int v = 10;
int invalid1[v];
int[] invalid2 = {1};
static int[] invalid3 = {1};
}
void invalid_arg1(int invalid[])
@@ -1,6 +1,7 @@
(1) : error 162: cannot create dynamic arrays in global scope - did you mean to create a fixed-length array with brackets after the variable name?
(6) : error 161: brackets after variable name indicate a fixed-size array, but a dynamic size was given - did you mean to use 'new int[size]' syntax?
(7) : error 160: brackets in between type and variable name indicate a dynamic-size array, but a fixed-size initializer was given
(10) : error 159: brackets after variable name indicate a fixed-size array, but size could not be determined - either specify sizes, an array initializer, or use dynamic syntax (such as 'char[] x')
(14) : error 160: brackets in between type and variable name indicate a dynamic-size array, but a fixed-size initializer was given
(8) : error 165: cannot create dynamic arrays in static scope - did you mean to create a fixed-length array with brackets after the variable name?
(11) : error 159: brackets after variable name indicate a fixed-size array, but size could not be determined - either specify sizes, an array initializer, or use dynamic syntax (such as 'char[] x')
(15) : error 160: brackets in between type and variable name indicate a dynamic-size array, but a fixed-size initializer was given