> please tell me if i made something wrong or if it is a gcc bug. Thanks for your bug report. It is a bug in your code, not in the compiler. Please note that bug-gcc is for reporting bugs, not for asking questions about C++. For that, use one of the public C++ fora, eg. comp.lang.c++.moderated, or comp.std.c++. Regards, Martin