Modify the tests to make sure const_val is actually a compile-time constant

This commit is contained in:
Stanislav Gromov 2022-02-02 21:54:55 +07:00 committed by Y_Less
parent 808720b066
commit de84898443
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,8 @@
const static const_val = 0;
const static const_val = 2;
PrintConstVal()
UseConstVal()
{
new a[const_val] = { 0, 1 };
#pragma unused a
printf("%d", const_val);
}

View File

@ -3,7 +3,7 @@
main()
{
PrintConstVal();
UseConstVal();
printf("%d", const_val); // error 017: undefined symbol "const_val"
// A combination of "const static" can't be used for local constants.