Hi, > Below sample program produced wrong code in g++ version 4.1.1. > Is this a bug or am I violating C++ standard? > (not taking range propagation into account?) It was due to my lack of knowledge, "Programming Language C++ 3rd ed." said assignment to enum which is out of range is undefined, (or something like that in Japanese...), so it is not g++ generating wrong code. Sorry for noice. Best Regards, (Hiroki Kaminaga) t --