This is a WIP for the second part of p1099, namely the 'using elaborated-enum-specifier ;' part. It's a WIP because I'd like advice on resolving some FIXMEs in the diff.
I added the parsing to ParseUsingDeclaration, even though the grammar describes a using-enum as a different kind of construct. It seems simplest to disambiguate it there, and AFAICT using-enum is valid in all the places a regular using decl is.
I still use a UsingDecl to represent the using-enum, and add some accessors and a new field to that (this is one of the FIXMEs, see the comment in the diff explaining further).
For instantiation, we can meet an uncompleted scoped enum. There doesnt seem to be a good routine to complete that case, Again a FIXME notes that RequireCompleteDeclContext wants a ScopeRef, which we don't have at the needed point.
There is some similarity and some differences with a using-enum vs regular using, and perhaps some helper routines might be broken out?
I considered a new UsingEnumDecl, but we still have the same chain of shadow decls to maintain, so that'd mean also breaking out the shadow list iterator stuff. Perhaps if we stored 2 bits in the shadowdecl pointer/int pair, and held a discriminator there, then the Enum field could overlay the QualifierLoc and DNLoc?