If a friend class declaration has no prior declarations, the class name is hidden from name lookup until it is subsequently declared. In some cases, the hidden name is stored in the type member of its cxx_binding structure. However, the name lookup code was not always checking this. This resulted in types being found prior to their declaration and, in one case, an internal compiler error. This patch adds missing checks via the hidden_name_p macro. Tested with a C/C++/Java bootstrap and testsuite run on i686-pc-linux-gnu. Ollie :ADDPATCH c++: 2007-05-18 Ollie Wild * name-lookup.c (ambiguous_decl): Adds check for hidden types. (unqualified_namespace_lookup): Adds check for hidden types. 2007-05-18 Ollie Wild * g++.dg/lookup/hidden-class10.C: New test. * g++.dg/lookup/hidden-class11.C: New test.