PATCH: fixes c++ friend class declaration lookup bugs

Ollie Wild aaw@google.com
Fri May 18 17:34:00 GMT 2007


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  <aaw@google.com>

       * name-lookup.c (ambiguous_decl): Adds check for hidden types.
       (unqualified_namespace_lookup): Adds check for hidden types.

2007-05-18  Ollie Wild  <aaw@google.com>

       * g++.dg/lookup/hidden-class10.C: New test.
       * g++.dg/lookup/hidden-class11.C: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hidden-class.patch
Type: text/x-patch
Size: 2036 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070518/e5621330/attachment.bin>


More information about the Gcc-patches mailing list