[C++ PATCH] Hidden functions

Nathan Sidwell nathan@acm.org
Wed May 24 11:35:00 GMT 2017


We have functions that are invisible to (most) name lookups:
1) anticipated builtins -- these only become visible once declared, but 
we need to know they match a builtin.
2) friends injected into namespace scope from a class definition.

This patch teaches the overload object about them with a new 
OVL_HIDDEN_P marker (so we can just look at the overload node), and more 
importantly it keeps them at the start of the overload list.  That'll 
make removing them from lookup results much simpler (a future patch).

Because of the ordering constraint, revealing a node is no longer so 
simple.  We may have to delete and reinsert it.  Thus a check after 
duplicate_decls discovers we're (re-)declaring a previously hidden decl.

The new testcases are to do with such unhiding.  anticipated builtins 
are always "C" functions, we need to do the check about extern "C" 
declarations matching.

nathan
-- 
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hidden.diff
Type: text/x-patch
Size: 10330 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170524/951129d7/attachment.bin>


More information about the Gcc-patches mailing list