Fixed constness of bit-fields.
This commit is contained in:
14
test/err/bug2018-bitfield.c
Normal file
14
test/err/bug2018-bitfield.c
Normal file
@@ -0,0 +1,14 @@
|
||||
/* Bug #2018 - Compiler has problems with const struct fields */
|
||||
|
||||
typedef union U {
|
||||
int a : 16;
|
||||
const int b : 16;
|
||||
} U;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
U x = { 42 };
|
||||
x.b = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user