> When I compile the above code with g++ 2.95 on linux without optimization > it compiles/works fine but when I compile with optimization I get: Thanks for your bug report. This is fixed in mainline compiler (2.96 19991202 (experimental)). Regards, Martin