This relies upon D101777 & D102239
This implements the 'using enum maybe-qualified-enum-tag ;' part of 1099. It introduces a new 'UsingEnumDecl', subclassed from 'BaseUsingDecl'. Much of the diff is the boilerplate needed to get the new class set up.
There is one case where we accept ill-formed, but I believe this is merely an extended case of an existing bug, so consider it orthogonal. AFAICT in class-scope the c++20 rule is that no 2 using decls can bring in the same target decl ([namespace.udecl]/8). But we already accept:
struct A { enum { a }; };
struct B : A { using A::a; };
struct C : B { using A::a;
using B::a; }; // same enumerator
this patch permits mixtures of 'using enum Bob;' and 'using Bob::member;' in the same way.
We need a detailed example in the documentation, since IIUC P1099 does not allow a using-enum-declaration to name "dependent" enums and thus is distinguished from using-declarations. Specifically the wording is:
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1099r5.html)
Now I'm not 100% clear on what that wording permits, but we need an example of how a UsingEnumDecl can be an instantiation. Something like this maybe?
We can also clarify the types here to
since there are no UnresolvedUsing*Decl` versions to account for, as there were with using decls.