Modify the tests to make sure const_val
is actually a compile-time constant
This commit is contained in:
parent
808720b066
commit
de84898443
@ -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);
|
||||
}
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user