Skip to content

Commit de84898

Browse files
Daniel-CortezY_Less
authored and
Y_Less
committed
Modify the tests to make sure const_val is actually a compile-time constant
1 parent 808720b commit de84898

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
const static const_val = 0;
1+
const static const_val = 2;
22

3-
PrintConstVal()
3+
UseConstVal()
44
{
5+
new a[const_val] = { 0, 1 };
6+
#pragma unused a
57
printf("%d", const_val);
68
}

source/compiler/tests/const_static.pwn

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
main()
55
{
6-
PrintConstVal();
6+
UseConstVal();
77
printf("%d", const_val); // error 017: undefined symbol "const_val"
88

99
// A combination of "const static" can't be used for local constants.

0 commit comments

Comments
 (0)