http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=178 The following appears to be an even smaller test case which provokes this bug: namespace NS { typedef int A; } enum NS::A foo(void);