Could you possibly post a plain C++ version too? Moreover, since this is an internal compiler error (just reproduced with both 3.0.3 and 3.1 current on i686-pc-linux-gnu), you should file a GNATS PR: http://gcc.gnu.org/cgi-bin/gnatsweb.pl Thanks, Paolo.