http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4240&database=gcc This is not a bug: original function is hidden by declaration in new scope.