c++ - Unexpected behaviour with a struct with enum bit field initialization C++14 -


i have struct bit field of type enum:

enum tcdata_format { a, b, c, d  };  struct ctypetc { tcdata_format input : 16; tcdata_format output : 16; }; 

and until c++11(vs2013) initialization worked fine:

ctypetc ctyp = { b, c }; 

but c++14(vs2015 update 1) initializes input , output 0. know why? guessing has enum bit fields.

edit : if try :

ctyp.input = b; ctyp.output = c; 

it works fine.


Comments