diff --git a/Examples/test-suite/anonymous_bitfield.i b/Examples/test-suite/anonymous_bitfield.i index eca2c6b84..309f82caf 100644 --- a/Examples/test-suite/anonymous_bitfield.i +++ b/Examples/test-suite/anonymous_bitfield.i @@ -9,6 +9,8 @@ struct Foo { unsigned int f : 1; unsigned int : 5; int z : 15; + unsigned int : 8+6; + unsigned seq : (sizeof(unsigned)*8 - 6); }; %} diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 5857e23cb..320a097a1 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -3448,7 +3448,7 @@ cpp_vend : cpp_const SEMI { ; -anonymous_bitfield : storage_class type COLON NUM_INT SEMI { }; +anonymous_bitfield : storage_class type COLON expr SEMI { }; /* ====================================================================== * PRIMITIVES @@ -3645,7 +3645,7 @@ def_args : EQUAL definetype { $$.bitfield = 0; $$.throws = 0; } - | COLON NUM_INT { + | COLON expr { $$.val = 0; $$.rawval = 0; $$.type = 0;