tccgen.c: Give error if statement expression found when const wanted.
commit99372bb1d399005824d1148431888a9b5b9d462b
authorEdmund Grimley Evans <Edmund.Grimley.Evans@gmail.com>
Thu, 26 Nov 2015 12:24:34 +0000 (26 12:24 +0000)
committerEdmund Grimley Evans <Edmund.Grimley.Evans@gmail.com>
Thu, 26 Nov 2015 12:28:42 +0000 (26 12:28 +0000)
tree95984e6dcbdc3bd1f6788239f827d33e01a521fc
parent51c3465a49858d07c54684dec45c9ad8f2b0f8a0
tccgen.c: Give error if statement expression found when const wanted.

Some test cases:

#define SE ({ switch (0) { } 0; })

// Should give error:
int x = SE;
void f(void) { static int x = SE; }
void f(void) { enum e { a = SE }; }
void f(void) { switch (0) { case SE: break; } }

// Correct:
int f(void) { return SE; }
int f(void) { return sizeof(SE); }
tccgen.c