c++: ADL refactor

Nathan Sidwell nathan@acm.org
Mon Nov 9 13:09:33 GMT 2020

Jason, this might be relevant to using enum, not sure.

This refactors the ADL lookup.  It just so happens the refactoring
makes dropping modules in simpler :) We break apart the namespace and
class fn processing, and move scope iteration to an outer function.
It'll also become possible to find the same enum in multiple place, so
we need to handle that idempotently.

         * cp-tree.h (LOOKUP_FOUND_P): Add ENUMERAL_TYPE.
         * name-lookup.c (class name_lookup): Add comments.
         (name_lookup::adl_namespace_only): Replace with ...
         (name_lookup::adl_class_fns): ... this and ...
         (name_lookup::adl_namespace_fns): ... this.
         (name_lookup::adl_namespace): Deal with inline nests here.
         (name_lookup::adl_class): Complete the type here.
         (name_lookup::adl_type): Call broken-out enum ..
         (name_lookup::adl_enum): New.  No need to call the namespace adl
         if it is class-scope.
         (name_lookup::search_adl): Iterate over collected scopes here.

pushing to trunk

Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adl.diff
Type: text/x-patch
Size: 8682 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201109/471486b2/attachment-0001.bin>

More information about the Gcc-patches mailing list